/** * {@inheritdoc} */ public function apply(Request $request, ParamConverter $configuration) { $name = $configuration->getName(); $uuid = $request->attributes->get($name, null); try { $request->attributes->set($name, $this->factory->fromString($uuid)); return true; } catch (InvalidArgumentException $exception) { throw new NotFoundHttpException(sprintf('The identifier "%s" is not valid.', $uuid)); } }