From 1f1e6b92a360b0c5a56d8da0bc9fe32f06d0514a Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Thu, 16 Dec 2021 14:38:24 +0100 Subject: [PATCH 1/2] Add various comments in the codebase --- src/Controller/Admin/BlogController.php | 2 +- src/Controller/BlogController.php | 7 +++++++ src/Security/PostVoter.php | 2 +- src/Utils/Validator.php | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Controller/Admin/BlogController.php b/src/Controller/Admin/BlogController.php index ac0129a85..34e14c874 100644 --- a/src/Controller/Admin/BlogController.php +++ b/src/Controller/Admin/BlogController.php @@ -30,7 +30,7 @@ * purposes. However, in your real Symfony application you should use any of the * existing bundles that let you generate ready-to-use backends without effort. * - * See http://knpbundles.com/keyword/admin + * See https://symfony.com/bundles/EasyAdminBundle/current/index.html * * @author Ryan Weaver * @author Javier Eguiluz diff --git a/src/Controller/BlogController.php b/src/Controller/BlogController.php index ac3f07362..508c3f4bc 100644 --- a/src/Controller/BlogController.php +++ b/src/Controller/BlogController.php @@ -81,6 +81,13 @@ public function postShow(Post $post): Response // have enabled the DebugBundle. Uncomment the following line to see it in action: // // dump($post, $this->getUser(), new \DateTime()); + // + // The result will be displayed either in the Symfony Profiler or in the stream output. + // See https://symfony.com/doc/current/profiler.html + // See https://symfony.com/doc/current/templates.html#the-dump-twig-utilities + // + // You can also leverage Symfony's 'dd()' function that dump and + // stop the execution return $this->render('blog/post_show.html.twig', ['post' => $post]); } diff --git a/src/Security/PostVoter.php b/src/Security/PostVoter.php index d4af08a8b..060cdaf29 100644 --- a/src/Security/PostVoter.php +++ b/src/Security/PostVoter.php @@ -37,7 +37,7 @@ class PostVoter extends Voter */ protected function supports(string $attribute, $subject): bool { - // this voter is only executed for three specific permissions on Post objects + // this voter is only executed on Post objects and for three specific permissions return $subject instanceof Post && \in_array($attribute, [self::SHOW, self::EDIT, self::DELETE], true); } diff --git a/src/Utils/Validator.php b/src/Utils/Validator.php index f1fc565cd..244928988 100644 --- a/src/Utils/Validator.php +++ b/src/Utils/Validator.php @@ -17,6 +17,7 @@ /** * This class is used to provide an example of integrating simple classes as * services into a Symfony application. + * See https://symfony.com/doc/current/service_container.html#creating-configuring-services-in-the-container * * @author Javier Eguiluz */ From f632ba755637db5960e279cf818d35b37443fa8f Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Thu, 23 Dec 2021 14:07:48 +0100 Subject: [PATCH 2/2] Composer v2.2 --- composer.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 284512db0..393277e81 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,12 @@ "preferred-install": { "*": "dist" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "symfony/flex": true, + "symfony/runtime": true + } }, "autoload": { "psr-4": {