diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 8612560f9..53ff869cc 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -427,18 +427,6 @@ 'count' => 1, 'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php', ]; -$ignoreErrors[] = [ - 'rawMessage' => 'Parameter #1 $headers of method Tests\\Authentication\\Filters\\AbstractFilterTestCase::withHeaders() expects array>, array{Authorization: non-falsy-string} given.', - 'identifier' => 'argument.type', - 'count' => 7, - 'path' => __DIR__ . '/tests/Authentication/Filters/HmacFilterTest.php', -]; -$ignoreErrors[] = [ - 'rawMessage' => 'Parameter #1 $headers of method Tests\\Authentication\\Filters\\JWTFilterTest::withHeaders() expects array>, array{Authorization: non-falsy-string} given.', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/tests/Authentication/Filters/JWTFilterTest.php', -]; $ignoreErrors[] = [ 'rawMessage' => 'Implicit array creation is not allowed - variable $users might not exist.', 'identifier' => 'variable.implicitArray', diff --git a/src/Authentication/Authenticators/JWT.php b/src/Authentication/Authenticators/JWT.php index 61deddb20..2a4c2e721 100644 --- a/src/Authentication/Authenticators/JWT.php +++ b/src/Authentication/Authenticators/JWT.php @@ -221,9 +221,7 @@ public function getTokenFromRequest(RequestInterface $request): string /** @var AuthJWT $config */ $config = config('AuthJWT'); - $tokenHeader = $request->getHeaderLine( - $config->authenticatorHeader ?? 'Authorization', - ); + $tokenHeader = $request->getHeaderLine($config->authenticatorHeader); if (str_starts_with($tokenHeader, 'Bearer')) { return trim(substr($tokenHeader, 6)); diff --git a/src/Authentication/Authenticators/Session.php b/src/Authentication/Authenticators/Session.php index 6897854b7..2b800c2a5 100644 --- a/src/Authentication/Authenticators/Session.php +++ b/src/Authentication/Authenticators/Session.php @@ -280,7 +280,7 @@ private function recordLoginAttempt( // Determine the type of ID we're using. // Standard fields would be email, username, // but any column within config('Auth')->validFields can be used. - $field = array_intersect(config('Auth')->validFields ?? [], array_keys($credentials)); + $field = array_intersect(config('Auth')->validFields, array_keys($credentials)); if (count($field) !== 1) { throw new InvalidArgumentException('Invalid credentials passed to recordLoginAttempt.');