src/Middleware/RequestAuthorizationMiddleware.php
protected function getServiceFromRequest(ServerRequestInterface $request)
    {
        $serviceAttribute = $this->getConfig('authorizationAttribute');
        $service = ($request->getAttribute($serviceAttribute));

        if (!$service instanceof AuthorizationServiceInterface) {
            $errorMessage = __CLASS__ . ' could not find the authorization service in the request attribute. ' .
                'Make sure you added the AuthorizationMiddleware before this middleware or that you ' .
                'somehow else added the service to the requests `' . $serviceAttribute . '` attribute.';

            throw new RuntimeException($errorMessage);
        }

        return $service;
    }
protected function getServiceFromRequest(ServerRequestInterface $request)
    {
        $serviceAttribute = $this->getConfig('authorizationAttribute');
        $service = ($request->getAttribute($serviceAttribute));

        if (!$service instanceof AuthorizationServiceInterface) {
            $errorMessage = __CLASS__ . ' could not find the authorization service in the request attribute. ' .
                'Make sure you added the AuthorizationMiddleware before this middleware or that you ' .
                'somehow else added the service to the requests `' . $serviceAttribute . '` attribute.';

            throw new RuntimeException($errorMessage);
        }

        return $service;
    }
protected function getServiceFromRequest ( ServerRequestInterface $ request ) { $ serviceAttribute = $ this -> getConfig ( 'authorizationAttribute' ) ; $ service = ( $ request -> getAttribute ( $ serviceAttribute ) ) ; if ( ! $ service instanceof AuthorizationServiceInterface ) { $ errorMessage = __CLASS__ . ' could not find the authorization service in the request attribute. ' . 'Make sure you added the AuthorizationMiddleware before this middleware or that you ' . 'somehow else added the service to the requests `' . $ serviceAttribute . '` attribute.' ; throw new RuntimeException ( $ errorMessage ) ; } return $ service ; }
Gets the authorization service from the request attribute

@param \Psr\Http\Message\ServerRequestInterface $request Server request.
@return \Authorization\AuthorizationServiceInterface
Gets the authorization service from the request attribute