public function checkCaptchaAfterUnSuccessfulUsernameLogin(Captcha $captcha, Counter $counter) { $counter->increaseFailedLoginUsernameCounter(); if ($counter->getFailedLoginUsernameCounter() >= Counter::CAPTCHA_STATUS_SWITCH_FAILED_LOGIN_USERNAME_ATTEMPTS) { $captcha->setCaptchaStatus(true); } return $captcha->getCaptchaStatus(); }