src/Controller/Component/AuthenticationComponent.php
public function getAuthenticationService()
    {
        $controller = $this->getController();
        $service = $controller->request->getAttribute('authentication');
        if ($service === null) {
            throw new Exception('The request object does not contain the required `authentication` attribute');
        }

        if (!($service instanceof AuthenticationServiceInterface)) {
            throw new Exception('Authentication service does not implement ' . AuthenticationServiceInterface::class);
        }

        return $service;
    }
public function getAuthenticationService()
    {
        $controller = $this->getController();
        $service = $controller->request->getAttribute('authentication');
        if ($service === null) {
            throw new Exception('The request object does not contain the required `authentication` attribute');
        }

        if (!($service instanceof AuthenticationServiceInterface)) {
            throw new Exception('Authentication service does not implement ' . AuthenticationServiceInterface::class);
        }

        return $service;
    }
public function getAuthenticationService ( ) { $ controller = $ this -> getController ( ) ; $ service = $ controller -> request -> getAttribute ( 'authentication' ) ; if ( $ service === null ) { throw new Exception ( 'The request object does not contain the required `authentication` attribute' ) ; } if ( ! ( $ service instanceof AuthenticationServiceInterface ) ) { throw new Exception ( 'Authentication service does not implement ' . AuthenticationServiceInterface :: class ) ; } return $ service ; }
Returns authentication service.

@return \Authentication\AuthenticationServiceInterface
@throws \Exception
Returns authentication service .