Description
Hello, i have a trouble about deprecation notice in phpunit, it's say Using "ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractFilter::apply()" is deprecated since 2.2. Use "ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractContextAwareFilter::apply()" with the "filters" context key instead
, if i disable order filter, the deprecation notice is disappear.
i've been talking about this to @dunglas from Slack api-platform channel, and he suggest me to check if request_stack
is null
, and when i check the request_stack
is null
and it's the intendended behaviour.
At method apply
in AbstractFilter
class, there a @trigger_error
triggered.
how if i move @trigger_error
after checking
if (null === $this->requestStack || null === $request = $this->requestStack->getCurrentRequest()) {
return;
}
so, that if request_stack
is not null, then apply method will run old behaviour with deprecated error, and if request_stack
is null like a new behaviour of filter, there will no deprecated error in apply method triggered.