src/Router.php
public function dispatchMatch(MatchContextInterface $match)
    {
        // store the previous request context.
        $request = $this->url->getRequestContext();

        $this->url->setRequestContext($match->getRequest());
        $this->routeStack->push($match->getName());

        $response = $this->mapper->mapResponse($this->dispatcher->dispatch($match));

        $this->routeStack->pop();

        // restore the previous request context.
        if (null !== $request) {
            $this->url->setRequestContext($request);
        }

        return $response;
    }
public function dispatchMatch(MatchContextInterface $match)
    {
        // store the previous request context.
        $request = $this->url->getRequestContext();

        $this->url->setRequestContext($match->getRequest());
        $this->routeStack->push($match->getName());

        $response = $this->mapper->mapResponse($this->dispatcher->dispatch($match));

        $this->routeStack->pop();

        // restore the previous request context.
        if (null !== $request) {
            $this->url->setRequestContext($request);
        }

        return $response;
    }
public function dispatchMatch ( MatchContextInterface $ match ) { // store the previous request context. $ request = $ this -> url -> getRequestContext ( ) ; $ this -> url -> setRequestContext ( $ match -> getRequest ( ) ) ; $ this -> routeStack -> push ( $ match -> getName ( ) ) ; $ response = $ this -> mapper -> mapResponse ( $ this -> dispatcher -> dispatch ( $ match ) ) ; $ this -> routeStack -> pop ( ) ; // restore the previous request context. if ( null !== $ request ) { $ this -> url -> setRequestContext ( $ request ) ; } return $ response ; }
Dispatches a request.

@param RequestContextInterface $request
@param MatchContextInterface $match

@return mixed the request response.
Dispatches a request .