public function isAuthenticated(): bool
    {
        if (!$this->securityContext->canBeInitialized()) {
            return false;
        }

        return array_reduce($this->securityContext->getAuthenticationTokens(), function (bool $isAuthenticated, TokenInterface $token) {
            return $isAuthenticated || $token->isAuthenticated();
        }, false);
    }
public function isAuthenticated(): bool
    {
        if (!$this->securityContext->canBeInitialized()) {
            return false;
        }

        return array_reduce($this->securityContext->getAuthenticationTokens(), function (bool $isAuthenticated, TokenInterface $token) {
            return $isAuthenticated || $token->isAuthenticated();
        }, false);
    }
public function isAuthenticated ( ) : bool { if ( ! $ this -> securityContext -> canBeInitialized ( ) ) { return false ; } return array_reduce ( $ this -> securityContext -> getAuthenticationTokens ( ) , function ( bool $ isAuthenticated , TokenInterface $ token ) { return $ isAuthenticated || $ token -> isAuthenticated ( ) ; } , false ) ; }
Returns true, if any account is currently authenticated

@return boolean true if any account is authenticated
Returns true if any account is currently authenticated