From 7f96a895e129bb6346cfc686136f04d7285c96f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 28 Jul 2023 13:05:29 +0200 Subject: [PATCH] DX: remove unused property on PersonController --- .../Controller/PersonController.php | 18 +++++++----------- .../config/services/controller.yaml | 5 ++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index ff04e1f95..522d616c9 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -49,15 +49,11 @@ final class PersonController extends AbstractController { public function __construct( private readonly AuthorizationHelperInterface $authorizationHelper, - protected SimilarPersonMatcher $similarPersonMatcher, - protected TranslatorInterface $translator, - protected EventDispatcherInterface $eventDispatcher, - /** - * @var PersonRepository; - */ - protected PersonRepository $personRepository, - protected ConfigPersonAltNamesHelper $configPersonAltNameHelper, - private readonly LoggerInterface $logger, + private readonly SimilarPersonMatcher $similarPersonMatcher, + private readonly TranslatorInterface $translator, + private readonly EventDispatcherInterface $eventDispatcher, + private readonly PersonRepository $personRepository, + private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper, private readonly ValidatorInterface $validator, private readonly EntityManagerInterface $em ) { @@ -256,7 +252,7 @@ final class PersonController extends AbstractController ); } - public function viewAction($person_id) + public function viewAction(int $person_id) { $person = $this->_getPerson($person_id); @@ -290,7 +286,7 @@ final class PersonController extends AbstractController * * @return \Chill\PersonBundle\Entity\Person */ - private function _getPerson(mixed $id) + private function _getPerson(int $id) { return $this->personRepository->find($id); } diff --git a/src/Bundle/ChillPersonBundle/config/services/controller.yaml b/src/Bundle/ChillPersonBundle/config/services/controller.yaml index 513b48262..434d1ea08 100644 --- a/src/Bundle/ChillPersonBundle/config/services/controller.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/controller.yaml @@ -1,6 +1,9 @@ services: - Chill\PersonBundle\Controller\PersonController: + _defaults: autowire: true + autoconfigure: true + + Chill\PersonBundle\Controller\PersonController: tags: ['controller.service_arguments'] Chill\PersonBundle\Controller\TimelinePersonController: