denyAccessUnlessGranted(SnipVoter::EDIT, $snip); return $this->render('version/index.html.twig', [ 'snip' => $snip, ]); } #[Route('/set/{version}', name: '_set')] public function set(Snip $snip, SnipContent $version): Response { $this->denyAccessUnlessGranted(SnipVoter::EDIT, $snip); $this->snipServiceFactory->create($snip)->setVersion($version); $this->addFlash('success', 'Snip version set to ' . $version->getId()); return $this->redirectToRoute('snip_single', ['snip' => $snip->getId()]); } }