public static function isCurrentPassword($currentPassword) { $userId = SessionOperator::getUser()->getUserId(); // Password matches if (QueryOperator::checkPassword($userId, $currentPassword)) { return true; } // Password does not match SessionOperator::setInputErrors(["currentPassword" => self::PASSWORD[self::INCORRECT_PASSWORD]]); return false; }