Skip to content

Commit 2b7005b

Browse files
Antoine MakdessiAntoine Makdessi
authored andcommitted
Add various comments in the codebase
1 parent 77a47d3 commit 2b7005b

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/Controller/Admin/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* purposes. However, in your real Symfony application you should use any of the
3131
* existing bundles that let you generate ready-to-use backends without effort.
3232
*
33-
* See http://knpbundles.com/keyword/admin
33+
* See https://symfony.com/bundles/EasyAdminBundle/current/index.html
3434
*
3535
* @author Ryan Weaver <[email protected]>
3636
* @author Javier Eguiluz <[email protected]>

src/Controller/BlogController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,17 @@ public function index(Request $request, int $page, string $_format, PostReposito
7575
#[Route('/posts/{slug}', methods: ['GET'], name: 'blog_post')]
7676
public function postShow(Post $post): Response
7777
{
78-
// Symfony's 'dump()' function is an improved version of PHP's 'var_dump()' but
78+
// Symfony's 'dump()' and 'dd()' functions are an improved version of PHP's 'var_dump()' but
7979
// it's not available in the 'prod' environment to prevent leaking sensitive information.
8080
// It can be used both in PHP files and Twig templates, but it requires to
8181
// have enabled the DebugBundle. Uncomment the following line to see it in action:
8282
//
8383
// dump($post, $this->getUser(), new \DateTime());
84+
// dd($post);
85+
//
86+
// The result will be displayed either in the Symfony Profiler or in the stream output.
87+
// See https://symfony.com/doc/current/profiler.html
88+
// See https://symfony.com/doc/current/templates.html#the-dump-twig-utilities
8489

8590
return $this->render('blog/post_show.html.twig', ['post' => $post]);
8691
}

src/Security/PostVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PostVoter extends Voter
3737
*/
3838
protected function supports(string $attribute, $subject): bool
3939
{
40-
// this voter is only executed for three specific permissions on Post objects
40+
// this voter is only executed on Post objects and for three specific permissions
4141
return $subject instanceof Post && \in_array($attribute, [self::SHOW, self::EDIT, self::DELETE], true);
4242
}
4343

src/Utils/Validator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/**
1818
* This class is used to provide an example of integrating simple classes as
1919
* services into a Symfony application.
20+
* See https://symfony.com/doc/current/service_container.html#creating-configuring-services-in-the-container
2021
*
2122
* @author Javier Eguiluz <[email protected]>
2223
*/

0 commit comments

Comments
 (0)