src/Knp/Menu/Matcher/Voter/RouteVoter.php
public function setRequest(Request $request)
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 2.3 and will be removed in 3.0. Pass a RequestStack in the constructor instead.', __METHOD__), E_USER_DEPRECATED);

        $this->request = $request;
    }
public function setRequest(Request $request)
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 2.3 and will be removed in 3.0. Pass a RequestStack in the constructor instead.', __METHOD__), E_USER_DEPRECATED);

        $this->request = $request;
    }
Sets the request against which the menu should be matched.

This Request is ignored in case a RequestStack is passed in the constructor.

@deprecated since version 2.3. Pass a RequestStack to the constructor instead.

@param Request $request