protected function buildRequest(Route $route, $name = null, array $parameters = array())
    {
        if (null !== $name) {
            $uri = $this->router->generate($name, $parameters);
        } else {
            $uri = $route->getPath();
        }

        return new Request(
            [], // GET
            [], // POST
            [], // Attributes
            [], // Cookies
            [], // Files
            [
                'REQUEST_URI'     => $uri,
                'DOCUMENT_URI'    => $uri,
                'SCRIPT_FILENAME' => realpath($this->kernel->getRootDir().'/../web').$this->baseUrl.'/app.php',
                'SCRIPT_NAME'     => $this->baseUrl.'/app.php'
            ], // Server
            null // Content
        );
    }
protected function buildRequest(Route $route, $name = null, array $parameters = array())
    {
        if (null !== $name) {
            $uri = $this->router->generate($name, $parameters);
        } else {
            $uri = $route->getPath();
        }

        return new Request(
            [], // GET
            [], // POST
            [], // Attributes
            [], // Cookies
            [], // Files
            [
                'REQUEST_URI'     => $uri,
                'DOCUMENT_URI'    => $uri,
                'SCRIPT_FILENAME' => realpath($this->kernel->getRootDir().'/../web').$this->baseUrl.'/app.php',
                'SCRIPT_NAME'     => $this->baseUrl.'/app.php'
            ], // Server
            null // Content
        );
    }
protected function buildRequest ( Route $ route , $ name = null , array $ parameters = array ( ) ) { if ( null !== $ name ) { $ uri = $ this -> router -> generate ( $ name , $ parameters ) ; } else { $ uri = $ route -> getPath ( ) ; } return new Request ( [ ] , // GET [ ] , // POST [ ] , // Attributes [ ] , // Cookies [ ] , // Files [ 'REQUEST_URI' => $ uri , 'DOCUMENT_URI' => $ uri , 'SCRIPT_FILENAME' => realpath ( $ this -> kernel -> getRootDir ( ) . '/../web' ) . $ this -> baseUrl . '/app.php' , 'SCRIPT_NAME' => $ this -> baseUrl . '/app.php' ] , // Server null // Content ) ; }
Builds a new request object based on the given route.

@param Route  $route      Route.
@param string $name       Name of the route.
@param array  $parameters Parameters of the request

@return Request
Builds a new request object based on the given route .