public function call(Request $request)
    {
        if($request !== $this->getRequestStack()->getCurrentRequest()){
            $this->getRequestStack()->push($request);
        }

        if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){
            $request->setRequestFormat($request->getFormat($request->getAcceptableContentTypes()[0]));
        }

        $response = $this->getRouter()
                ->find($request)
                ->call($this->getServices());

        if($response instanceof Response){
            return $response;
        }
        return new Response($response);
    }
public function call(Request $request)
    {
        if($request !== $this->getRequestStack()->getCurrentRequest()){
            $this->getRequestStack()->push($request);
        }

        if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){
            $request->setRequestFormat($request->getFormat($request->getAcceptableContentTypes()[0]));
        }

        $response = $this->getRouter()
                ->find($request)
                ->call($this->getServices());

        if($response instanceof Response){
            return $response;
        }
        return new Response($response);
    }
public function call ( Request $ request ) { if ( $ request !== $ this -> getRequestStack ( ) -> getCurrentRequest ( ) ) { $ this -> getRequestStack ( ) -> push ( $ request ) ; } if ( ! $ request -> getRequestFormat ( null ) && $ request -> getAcceptableContentTypes ( ) ) { $ request -> setRequestFormat ( $ request -> getFormat ( $ request -> getAcceptableContentTypes ( ) [ 0 ] ) ) ; } $ response = $ this -> getRouter ( ) -> find ( $ request ) -> call ( $ this -> getServices ( ) ) ; if ( $ response instanceof Response ) { return $ response ; } return new Response ( $ response ) ; }
Calls the controller matched with the request uri.

@param Request $request
@return Response
Calls the controller matched with the request uri .