Skip to content

Commit 6c1e93a

Browse files
committed
minor #1315 Update PHP doc about annotations IsGranted (adpauly)
This PR was squashed before being merged into the main branch. Discussion ---------- Update PHP doc about annotations IsGranted The doc now suggests to use PHP attributes instead of "old" annotation for "IsGranted" instruction. Sorry if my PR format doesn't match with your requirements. I just wanna help. :) Commits ------- 81a39d8 Update PHP doc about annotations IsGranted
2 parents 05129f2 + 81a39d8 commit 6c1e93a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Controller/Admin/BlogController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
112112
public function show(Post $post): Response
113113
{
114114
// This security check can also be performed
115-
// using an annotation: @IsGranted("show", subject="post", message="Posts can only be shown to their authors.")
115+
// using a PHP attribute: #[IsGranted('show', subject: 'post', message: 'Posts can only be shown to their authors.')]
116116
$this->denyAccessUnlessGranted(PostVoter::SHOW, $post, 'Posts can only be shown to their authors.');
117117

118118
return $this->render('admin/blog/show.html.twig', [

0 commit comments

Comments
 (0)