public static function validateNewPassword($userId, $newPassword, $max = self::MAX_PASSWORD_CHANGES_BEFORE_REUSE)
    {
        $recentPasswords = UserPasswordChange::query()
            ->where("user_id = :user_id:")
            ->bind(["user_id" => $userId])
            ->orderBy("date_changed DESC")
            ->limit($max - 1)
            ->execute()
            ->toArray();

        foreach ($recentPasswords as $aRecentPassword) {
            if (Utils::verifyPassword($newPassword, $aRecentPassword['password_hash'])) {
                throw new PasswordChangeException("You cannot use any of your last {$max} passwords");
            }
        }
    }