repository = $repository; } /** * {@inheritdoc} * * @return Basket */ public function convert($id) { if (null === $basket = $this->repository->find((int) $id)) { throw new NotFoundHttpException(sprintf('Basket %s not found.', $id)); } return $basket; } }