private function getSecretSantaOrThrow404(Request $request, $hash) { $secretSanta = $request->getSession()->get($this->getSecretSantaSessionKey($hash)); if (!$secretSanta) { throw new NotFoundHttpException(); } return $secretSanta; }