/**
* @param AuthenticatorInterface[] $authenticators
*/
private function executeAuthenticators(array
$authenticators, Request
$request): ?Response
{ foreach ($authenticators as $authenticator) { // recheck if the authenticator still supports the listener. supports() is called
// eagerly (before token storage is initialized), whereas authenticate() is called
// lazily (after initialization).
if (false ===
$authenticator->
supports($request)) { $this->logger?->
debug('Skipping the "{authenticator}" authenticator as it did not support the request.',
['authenticator'
=> ($authenticator instanceof TraceableAuthenticator ?
$authenticator->
getAuthenticator() :
$authenticator)::
class]);
continue;
} $response =
$this->
executeAuthenticator($authenticator,
$request);
if (null !==
$response) { $this->logger?->
debug('The "{authenticator}" authenticator set the response. Any later authenticator will not be called',
['authenticator'
=> ($authenticator instanceof TraceableAuthenticator ?
$authenticator->
getAuthenticator() :
$authenticator)::
class]);
return $response;
} }