src/Middleware/UnauthorizedHandler/HandlerFactory.php
public static function create($name)
    {
        $class = App::className($name, 'Middleware/UnauthorizedHandler', 'Handler');
        if (!$class) {
            $message = sprintf('Handler `%s` does not exist.', $name);
            throw new RuntimeException($message);
        }

        $instance = new $class();
        if (!$instance instanceof HandlerInterface) {
            $message = sprintf('Handler should implement `%s`, got `%s`.', HandlerInterface::class, get_class($instance));
            throw new RuntimeException($message);
        }

        return $instance;
    }
public static function create($name)
    {
        $class = App::className($name, 'Middleware/UnauthorizedHandler', 'Handler');
        if (!$class) {
            $message = sprintf('Handler `%s` does not exist.', $name);
            throw new RuntimeException($message);
        }

        $instance = new $class();
        if (!$instance instanceof HandlerInterface) {
            $message = sprintf('Handler should implement `%s`, got `%s`.', HandlerInterface::class, get_class($instance));
            throw new RuntimeException($message);
        }

        return $instance;
    }
public static function create ( $ name ) { $ class = App :: className ( $ name , 'Middleware/UnauthorizedHandler' , 'Handler' ) ; if ( ! $ class ) { $ message = sprintf ( 'Handler `%s` does not exist.' , $ name ) ; throw new RuntimeException ( $ message ) ; } $ instance = new $ class ( ) ; if ( ! $ instance instanceof HandlerInterface ) { $ message = sprintf ( 'Handler should implement `%s`, got `%s`.' , HandlerInterface :: class , get_class ( $ instance ) ) ; throw new RuntimeException ( $ message ) ; } return $ instance ; }
Creates unauthorized request handler.

@param string $name UnauthorizedHandler name.
@return \Authorization\Middleware\UnauthorizedHandler\HandlerInterface
@throws \RuntimeException When invalid handler encountered.
Creates unauthorized request handler .