- if ($requestStack instanceof RequestMatcherInterface || (null !== $matcher && !$matcher instanceof RequestMatcherInterface) || $onlyMasterRequests instanceof RequestStack) {
- $tmp = $onlyMasterRequests;
- $onlyMasterRequests = $onlyException;
- $onlyException = $matcher;
- $matcher = $requestStack;
- $requestStack = func_num_args() < 5 ? null : $tmp;
-
- @trigger_error('The '.__METHOD__.' method now requires a RequestStack to be given as second argument as '.__CLASS__.'::onKernelRequest method will be removed in 3.0.', E_USER_DEPRECATED);
- } elseif (!$requestStack instanceof RequestStack) {
- @trigger_error('The '.__METHOD__.' method now requires a RequestStack instance as '.__CLASS__.'::onKernelRequest method will be removed in 3.0.', E_USER_DEPRECATED);
- }
-
- if (null !== $requestStack && !$requestStack instanceof RequestStack) {
- throw new \InvalidArgumentException('RequestStack instance expected.');
- }
- if (null !== $matcher && !$matcher instanceof RequestMatcherInterface) {
- throw new \InvalidArgumentException('Matcher must implement RequestMatcherInterface.');
- }
-