src/Middleware/AuthorizationMiddleware.php
protected function getAuthorizationService($request, $response)
    {
        $service = $this->subject;
        if ($this->subject instanceof AuthorizationServiceProviderInterface) {
            $service = $this->subject->getAuthorizationService($request, $response);
        }

        if (!$service instanceof AuthorizationServiceInterface) {
            throw new RuntimeException(sprintf(
                'Invalid service returned from the provider. `%s` does not implement `%s`.',
                is_object($service) ? get_class($service) : gettype($service),
                AuthorizationServiceInterface::class
            ));
        }

        return $service;
    }
protected function getAuthorizationService($request, $response)
    {
        $service = $this->subject;
        if ($this->subject instanceof AuthorizationServiceProviderInterface) {
            $service = $this->subject->getAuthorizationService($request, $response);
        }

        if (!$service instanceof AuthorizationServiceInterface) {
            throw new RuntimeException(sprintf(
                'Invalid service returned from the provider. `%s` does not implement `%s`.',
                is_object($service) ? get_class($service) : gettype($service),
                AuthorizationServiceInterface::class
            ));
        }

        return $service;
    }
protected function getAuthorizationService ( $ request , $ response ) { $ service = $ this -> subject ; if ( $ this -> subject instanceof AuthorizationServiceProviderInterface ) { $ service = $ this -> subject -> getAuthorizationService ( $ request , $ response ) ; } if ( ! $ service instanceof AuthorizationServiceInterface ) { throw new RuntimeException ( sprintf ( 'Invalid service returned from the provider. `%s` does not implement `%s`.' , is_object ( $ service ) ? get_class ( $ service ) : gettype ( $ service ) , AuthorizationServiceInterface :: class ) ) ; } return $ service ; }
Returns AuthorizationServiceInterface instance.

@param \Psr\Http\Message\ServerRequestInterface $request Server request.
@param \Psr\Http\Message\ResponseInterface $response Response.
@return \Authorization\AuthorizationServiceInterface
@throws \RuntimeException When authorization method has not been defined.
Returns AuthorizationServiceInterface instance .