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