public function process(HTTPRequest $request, callable $delegate)
    {
        /** @var HTTPResponse $response */
        $response = $delegate($request);

        // Ignore by regexes.
        if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {
            return $response;
        }

        foreach ($this->requestedPolicies as $requestedPolicy) {
            /** @var ControllerPolicy $policyInstance */
            $policyInstance = $requestedPolicy['policy'];

            $policyInstance->applyToResponse(
                $requestedPolicy['originator'],
                $request,
                $response
            );
        }

        return $response;
    }
public function process(HTTPRequest $request, callable $delegate)
    {
        /** @var HTTPResponse $response */
        $response = $delegate($request);

        // Ignore by regexes.
        if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {
            return $response;
        }

        foreach ($this->requestedPolicies as $requestedPolicy) {
            /** @var ControllerPolicy $policyInstance */
            $policyInstance = $requestedPolicy['policy'];

            $policyInstance->applyToResponse(
                $requestedPolicy['originator'],
                $request,
                $response
            );
        }

        return $response;
    }
public function process ( HTTPRequest $ request , callable $ delegate ) { /** @var HTTPResponse $response */ $ response = $ delegate ( $ request ) ; // Ignore by regexes. if ( $ this -> shouldCheckHttpHost ( ) && $ this -> isIgnoredDomain ( $ _SERVER [ 'HTTP_HOST' ] ) ) { return $ response ; } foreach ( $ this -> requestedPolicies as $ requestedPolicy ) { /** @var ControllerPolicy $policyInstance */ $ policyInstance = $ requestedPolicy [ 'policy' ] ; $ policyInstance -> applyToResponse ( $ requestedPolicy [ 'originator' ] , $ request , $ response ) ; } return $ response ; }
Apply all the requested policies.

@param  HTTPRequest  $request
@param  callable $delegate
@return HTTPResponse
Apply all the requested policies .