repository = $repository; } /** * {@inheritdoc} * * @return Token */ public function convert($value) { if (null === $token = $this->repository->findValidToken($value)) { throw new NotFoundHttpException('Token is not valid.'); } return $token; } }