resolver = $resolver; } public function apply(Request $request, ParamConverter $configuration) { $provider = $request->get('provider'); try { $request->attributes->set('provider', $this->resolver->resolve($provider)); } catch (NonExistentServiceException $exception) { throw new NotFoundHttpException("There is no such provider as '$provider'.", $exception); } } public function supports(ParamConverter $configuration) { return $configuration->getName() === 'provider' && is_a($configuration->getClass(), Provider::class, true); } }