[TOOLS] Fix all issues found by PHPStan level 2

This commit is contained in:
2021-09-06 23:47:28 +01:00
parent 4b1780a2ee
commit 4e30e5aad9
33 changed files with 114 additions and 89 deletions

View File

@@ -21,6 +21,7 @@ namespace App\Security;
use App\Core\DB\DB;
use function App\Core\I18n\_m;
use App\Entity\LocalUser;
use App\Entity\User;
use App\Util\Nickname;
use Exception;
@@ -31,7 +32,6 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
@@ -103,7 +103,11 @@ class Authenticator extends AbstractFormLoginAuthenticator
return $user;
}
public function checkCredentials($credentials, UserInterface $user)
/**
* @param LocalUser $user
* @param mixed $credentials
*/
public function checkCredentials($credentials, $user)
{
if (!$user->checkPassword($credentials['password'])) {
throw new CustomUserMessageAuthenticationException(_m('Invalid login credentials.'));