src/MvcRouteListener.php
/**
     * Trigger the authorization event
     *
     * @param MvcEvent $mvcEvent
     * @return null|Response
     */
Trigger the authorization event
@param MvcEvent $mvcEvent
@return null|Response
Trigger the authorization event @param MvcEvent $mvcEvent @return null|Response
public function authorization(MvcEvent $mvcEvent)
    {
        if (! $mvcEvent->getRequest() instanceof HttpRequest
            || $mvcEvent->getRequest()->isOptions()
        ) {
            return;
        }
        $mvcAuthEvent = $this->mvcAuthEvent;
        $mvcAuthEvent->setName($mvcAuthEvent::EVENT_AUTHORIZATION);
        $responses = $this->events->triggerEventUntil(function ($r) {
            return (is_bool($r) || $r instanceof Response);
        }, $mvcAuthEvent);
        $result = $responses->last();
        if (is_bool($result)) {
            $mvcAuthEvent->setIsAuthorized($result);
            return;
        }
        if ($result instanceof Response) {
            return $result;
        }
    }
public function authorization ( MvcEvent $ mvcEvent ) { if ( ! $ mvcEvent -> getRequest ( ) instanceof HttpRequest || $ mvcEvent -> getRequest ( ) -> isOptions ( ) ) { return ; } $ mvcAuthEvent = $ this -> mvcAuthEvent ; $ mvcAuthEvent -> setName ( $ mvcAuthEvent :: EVENT_AUTHORIZATION ) ; $ responses = $ this -> events -> triggerEventUntil ( function ( $ r ) { return ( is_bool ( $ r ) || $ r instanceof Response ) ; } , $ mvcAuthEvent ) ; $ result = $ responses -> last ( ) ; if ( is_bool ( $ result ) ) { $ mvcAuthEvent -> setIsAuthorized ( $ result ) ; return ; } if ( $ result instanceof Response ) { return $ result ; } }
Trigger the authorization event
 @param MvcEvent $mvcEvent
 @return null|Response
Trigger the authorization event @param MvcEvent $mvcEvent @return null|Response