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