$voter->setRequest() deprecated in KnpMenu
mgiraud opened this issue · comments
Larmuze commented
Hello,
The VoterInitializerListener
sets the request to voters : https://github.com/KnpLabs/KnpMenuBundle/blob/master/EventListener/VoterInitializerListener.php#L16
public function onKernelRequest(GetResponseEvent $event)
{
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
foreach ($this->voters as $voter) {
if (method_exists($voter, 'setRequest')) {
$voter->setRequest($event->getRequest());
}
}
}
However the setRequest
is deprecated in the KnpMenu 2.3 : https://github.com/KnpLabs/KnpMenu/blob/master/src/Knp/Menu/Matcher/Voter/RouteVoter.php#L51
which triggers deprecation warnings when using phpunit
Christophe Coevoet commented
Fixed by #358