public function process(Request $request)
    {
        $result = new Result;

        $stage = static::STAGE_FILTER;

        foreach ($this->processors as $processor)
        {
            if ($processor['stage'] < $stage)
                continue;

            $stage = $processor['stage'];
            $processor = $processor['processor'];
            try
            {
                $processor->process($request, $result);
            }
            catch (Response\Response $response)
            {
                $result->setResponse($response);
                $stage = static::STAGE_POSTPROCESS;
            }
        }

        return $result;
    }
public function process(Request $request)
    {
        $result = new Result;

        $stage = static::STAGE_FILTER;

        foreach ($this->processors as $processor)
        {
            if ($processor['stage'] < $stage)
                continue;

            $stage = $processor['stage'];
            $processor = $processor['processor'];
            try
            {
                $processor->process($request, $result);
            }
            catch (Response\Response $response)
            {
                $result->setResponse($response);
                $stage = static::STAGE_POSTPROCESS;
            }
        }

        return $result;
    }
public function process ( Request $ request ) { $ result = new Result ; $ stage = static :: STAGE_FILTER ; foreach ( $ this -> processors as $ processor ) { if ( $ processor [ 'stage' ] < $ stage ) continue ; $ stage = $ processor [ 'stage' ] ; $ processor = $ processor [ 'processor' ] ; try { $ processor -> process ( $ request , $ result ) ; } catch ( Response \ Response $ response ) { $ result -> setResponse ( $ response ) ; $ stage = static :: STAGE_POSTPROCESS ; } } return $ result ; }
Process a request - put it through the pipeline and return the response. The request
will be routed through each processor until one throws an exception at which point the
stage is advanced to the post processing stage.

@param Request $request The request to process
@return Result The produced response
Process a request - put it through the pipeline and return the response . The request will be routed through each processor until one throws an exception at which point the stage is advanced to the post processing stage .