From a9f4f8c973cc9d4ef797c7108955e03eefb0a13d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 2 Jul 2024 14:17:05 +0200 Subject: [PATCH] Resolve phpstan erorrs --- .../Service/WorkflowDocumentService.php | 2 +- .../AccompanyingCourseDocumentWorkflowHandler.php | 9 ++++----- .../Form/ChoiceLoader/EventChoiceLoader.php | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Service/WorkflowDocumentService.php b/src/Bundle/ChillDocStoreBundle/Service/WorkflowDocumentService.php index 17591b2d0..a279912a9 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/WorkflowDocumentService.php +++ b/src/Bundle/ChillDocStoreBundle/Service/WorkflowDocumentService.php @@ -23,7 +23,7 @@ class WorkflowDocumentService $currentUser = $this->security->getUser(); - if (null !== $workflow) { + if (null != $workflow) { if ($workflow->isFinal()) { return false; } diff --git a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php index e3f201914..d1a384ef3 100644 --- a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php +++ b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php @@ -22,14 +22,13 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Symfony\Contracts\Translation\TranslatorInterface; -class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandlerInterface +readonly class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandlerInterface { public function __construct( - EntityManagerInterface $em, - private readonly TranslatorInterface $translator, - private readonly EntityWorkflowRepository $workflowRepository, - private readonly AccompanyingCourseDocumentRepository $repository + private TranslatorInterface $translator, + private EntityWorkflowRepository $workflowRepository, + private AccompanyingCourseDocumentRepository $repository ) { } diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php index 9aa001170..19829a369 100644 --- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php +++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\EventBundle\Form\ChoiceLoader; use Chill\EventBundle\Entity\Event; +use Chill\EventBundle\Repository\EventRepository; use Doctrine\ORM\EntityRepository; use Symfony\Component\Form\ChoiceList\ChoiceListInterface; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; @@ -26,9 +27,6 @@ class EventChoiceLoader implements ChoiceLoaderInterface */ protected $centers = []; - /** - * @var EntityRepository - */ protected $eventRepository; /** @@ -40,7 +38,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface * EventChoiceLoader constructor. */ public function __construct( - EntityRepository $eventRepository, + EventRepository $eventRepository, ?array $centers = null ) { $this->eventRepository = $eventRepository;