diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9aae1c43f..d58586b79 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -112,6 +112,7 @@ $rules = array_merge( ], 'sort_algorithm' => 'alpha', ], + 'single_line_empty_body' => true, ], $rules, $riskyRules, diff --git a/composer.json b/composer.json index f3bcba635..0aa12badf 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": ">= 7.5", - "rector/rector": "^0.17.7", + "rector/rector": "^0.19.0", "symfony/debug-bundle": "^5.4", "symfony/dotenv": "^5.4", "symfony/maker-bundle": "^1.20", diff --git a/rector.php b/rector.php index 80459534a..6b7e1d241 100644 --- a/rector.php +++ b/rector.php @@ -50,9 +50,6 @@ return static function (RectorConfig $rectorConfig): void { // skip some path... $rectorConfig->skip([ - // we need to discuss this: are we going to have FALSE in tests instead of an error ? - \Rector\Php71\Rector\FuncCall\CountOnNullRector::class, - // we must adapt service definition \Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class, \Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class, diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 25dd3fedd..7098f283e 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -675,8 +675,8 @@ final class ActivityController extends AbstractController throw $this->createNotFoundException('Accompanying Period not found'); } - // TODO Add permission - // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + // TODO Add permission + // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); } else { throw $this->createNotFoundException('Person or Accompanying Period not found'); } diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php index fccf8172c..67f65d994 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php @@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request; */ class ActivityReasonCategoryController extends AbstractController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Creates a new ActivityReasonCategory entity. * @@ -59,7 +58,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); @@ -82,7 +81,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll(); + $entities = $em->getRepository(ActivityReasonCategory::class)->findAll(); return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [ 'entities' => $entities, @@ -114,7 +113,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); @@ -134,7 +133,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index f7a35565a..cb6514656 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -60,7 +60,7 @@ class ActivityReasonController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (null === $entity) { throw new NotFoundHttpException('Unable to find ActivityReason entity.'); @@ -115,7 +115,7 @@ class ActivityReasonController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReason entity.'); @@ -135,7 +135,7 @@ class ActivityReasonController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReason entity.'); diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 9407aecbe..c34e4b3a9 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -36,6 +36,7 @@ use DateTime; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Serializer\Annotation\Context; use Symfony\Component\Serializer\Annotation\DiscriminatorMap; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\SerializedName; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 03a21a5b7..4e3b1eb8a 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -404,7 +404,7 @@ class ActivityType extends AbstractType ->setAllowedTypes('center', ['null', Center::class, 'array']) ->setAllowedTypes('role', ['string']) ->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class) - ->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']); + ->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']); } public function getBlockPrefix(): string diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index e76aaf5ee..797d64eb6 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -27,7 +27,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /** @var \Chill\PersonBundle\Entity\Person $person */ + /** @var Person $person */ $person = $parameters['person']; if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index 38aa49cdf..31012569a 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase } /** - * @return \Chill\ActivityBundle\Entity\ActivityType + * @return ActivityType */ private function getRandomActivityType() { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php index 8ff85221f..b983c08a4 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php @@ -35,7 +35,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter'); $request = $this->prophesize() - ->willExtend(\Symfony\Component\HttpFoundation\Request::class); + ->willExtend(Request::class); $request->getLocale()->willReturn('fr'); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php index f48179614..c6ecc377c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php @@ -58,7 +58,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase $this->assertTrue($form->isSynchronized()); $this->assertInstanceOf( - \Chill\ActivityBundle\Entity\ActivityType::class, + ActivityType::class, $form->getData()['type'], 'The data is an instance of Chill\\ActivityBundle\\Entity\\ActivityType' ); @@ -83,7 +83,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase } /** - * @return \Chill\ActivityBundle\Entity\ActivityType + * @return ActivityType */ protected function getRandomType(mixed $active = true) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 039d9efde..0797f2f56 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -407,7 +407,7 @@ class CalendarController extends AbstractController } /** @var Calendar $entity */ - $entity = $em->getRepository(\Chill\CalendarBundle\Entity\Calendar::class)->find($id); + $entity = $em->getRepository(Calendar::class)->find($id); if (null === $entity) { throw $this->createNotFoundException('Unable to find Calendar entity.'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php index 08425bcf0..de3f0cf5b 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php +++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php @@ -86,7 +86,7 @@ class CreateFieldsOnGroupCommand extends Command $em = $this->entityManager; $customFieldsGroups = $em - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findAll(); if (0 === \count($customFieldsGroups)) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php index b9c574ddc..38b5ef975 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php @@ -121,7 +121,7 @@ class CustomFieldController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)->find($id); + $entity = $em->getRepository(CustomField::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomField entity.'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index 92923b331..61c72f610 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -37,7 +37,10 @@ class CustomFieldsGroupController extends AbstractController * CustomFieldsGroupController constructor. */ public function __construct( - private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + private readonly CustomFieldProvider $customFieldProvider, + private readonly TranslatorInterface $translator, + private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry + ) {} /** * Creates a new CustomFieldsGroup entity. @@ -79,7 +82,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); @@ -102,7 +105,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->managerRegistry->getManager(); - $cfGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findAll(); + $cfGroups = $em->getRepository(CustomFieldsGroup::class)->findAll(); $defaultGroups = $this->getDefaultGroupsId(); $makeDefaultFormViews = []; @@ -134,13 +137,13 @@ class CustomFieldsGroupController extends AbstractController $em = $this->managerRegistry->getManager(); - $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId); + $cFGroup = $em->getRepository(CustomFieldsGroup::class)->findOneById($cFGroupId); if (!$cFGroup) { throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}"); } - $cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class) + $cFDefaultGroup = $em->getRepository(CustomFieldsDefaultGroup::class) ->findOneByEntity($cFGroup->getEntity()); if ($cFDefaultGroup) { @@ -195,7 +198,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.'); @@ -239,7 +242,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); @@ -263,7 +266,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php index 35d9ca3a3..48d4847d6 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php @@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; final class CustomFieldsChoiceTest extends KernelTestCase { /** - * @var \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice + * @var CustomFieldChoice */ private $cfChoice; diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php index 87722c1bd..2d1268e71 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php @@ -43,7 +43,7 @@ final class CustomFieldsTextTest extends WebTestCase $customField ); $this->assertInstanceOf( - \Chill\CustomFieldsBundle\CustomFields\CustomFieldText::class, + CustomFieldText::class, $customField ); } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php index 54889f518..b9c29aff9 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php @@ -47,7 +47,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface return; } - /** @var \Chill\DocGeneratorBundle\Service\Messenger\RequestGenerationMessage $message */ + /** @var RequestGenerationMessage $message */ $message = $event->getEnvelope()->getMessage(); $this->logger->error(self::LOG_PREFIX.'Docgen failed', [ diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php index 6d84036a5..7803f24e4 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php @@ -25,9 +25,8 @@ use Symfony\Component\Routing\Annotation\Route; */ class DocumentCategoryController extends AbstractController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * @Route("/{bundleId}/{idInsideBundle}", name="document_category_delete", methods="DELETE") */ @@ -35,7 +34,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); @@ -55,7 +54,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); @@ -138,7 +137,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->managerRegistry->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); diff --git a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php index 659395034..40b1a73b8 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php @@ -41,7 +41,7 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") * - * @var \Chill\MainBundle\Entity\Scope The document's center + * @var Scope The document's center */ private ?\Chill\MainBundle\Entity\Scope $scope = null; diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 91bba2a0b..06233905c 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -93,7 +93,7 @@ class EventController extends AbstractController public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); - $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([ + $event = $em->getRepository(Event::class)->findOneBy([ 'id' => $event_id, ]); @@ -147,7 +147,7 @@ class EventController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); + $entity = $em->getRepository(Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); @@ -174,7 +174,7 @@ class EventController extends AbstractController { $em = $this->managerRegistry->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); if (null === $person) { throw $this->createNotFoundException('Person not found'); @@ -188,11 +188,11 @@ class EventController extends AbstractController $person->getCenter() ); - $total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id); + $total = $em->getRepository(Participation::class)->countByPerson($person_id); $paginator = $this->paginator->create($total); - $participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle( + $participations = $em->getRepository(Participation::class)->findByPersonInCircle( $person_id, $reachablesCircles, $paginator->getCurrentPage()->getFirstItemNumber(), @@ -353,7 +353,7 @@ class EventController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); + $entity = $em->getRepository(Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php index 1b120876f..11cddbf77 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php @@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request; */ class EventTypeController extends AbstractController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Creates a new EventType entity. * @@ -62,7 +61,7 @@ class EventTypeController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -84,7 +83,7 @@ class EventTypeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -109,7 +108,7 @@ class EventTypeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll(); + $entities = $em->getRepository(EventType::class)->findAll(); return $this->render('@ChillEvent/EventType/index.html.twig', [ 'entities' => $entities, @@ -141,7 +140,7 @@ class EventTypeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -164,7 +163,7 @@ class EventTypeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index b40a2d865..bd6f58d54 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -34,7 +34,10 @@ class ParticipationController extends AbstractController * ParticipationController constructor. */ public function __construct( - private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + private readonly LoggerInterface $logger, + private readonly TranslatorInterface $translator, + private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry + ) {} /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create") @@ -240,7 +243,7 @@ class ParticipationController extends AbstractController public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { $em = $this->managerRegistry->getManager(); - $participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([ + $participation = $em->getRepository(Participation::class)->findOneBy([ 'id' => $participation_id, ]); @@ -320,7 +323,7 @@ class ParticipationController extends AbstractController */ public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse { - $event = $this->managerRegistry->getRepository(\Chill\EventBundle\Entity\Event::class) + $event = $this->managerRegistry->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -456,8 +459,8 @@ class ParticipationController extends AbstractController */ public function updateMultipleAction(mixed $event_id, Request $request) { - /** @var \Chill\EventBundle\Entity\Event $event */ - $event = $this->managerRegistry->getRepository(\Chill\EventBundle\Entity\Event::class) + /** @var Event $event */ + $event = $this->managerRegistry->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -499,7 +502,7 @@ class ParticipationController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ protected function createEditFormMultiple(Collection $participations, Event $event) { @@ -558,7 +561,7 @@ class ParticipationController extends AbstractController // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` if (null !== $event_id) { - $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class) + $event = $em->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -752,7 +755,7 @@ class ParticipationController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ private function createDeleteForm($participation_id) { diff --git a/src/Bundle/ChillEventBundle/Controller/RoleController.php b/src/Bundle/ChillEventBundle/Controller/RoleController.php index 17cbd0870..7d3e6e0f1 100644 --- a/src/Bundle/ChillEventBundle/Controller/RoleController.php +++ b/src/Bundle/ChillEventBundle/Controller/RoleController.php @@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request; */ class RoleController extends AbstractController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Creates a new Role entity. * @@ -62,7 +61,7 @@ class RoleController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -84,7 +83,7 @@ class RoleController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -109,7 +108,7 @@ class RoleController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll(); + $entities = $em->getRepository(Role::class)->findAll(); return $this->render('@ChillEvent/Role/index.html.twig', [ 'entities' => $entities, @@ -141,7 +140,7 @@ class RoleController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -164,7 +163,7 @@ class RoleController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/StatusController.php b/src/Bundle/ChillEventBundle/Controller/StatusController.php index 63c6980d1..294ca0222 100644 --- a/src/Bundle/ChillEventBundle/Controller/StatusController.php +++ b/src/Bundle/ChillEventBundle/Controller/StatusController.php @@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request; */ class StatusController extends AbstractController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Creates a new Status entity. * @@ -62,7 +61,7 @@ class StatusController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -84,7 +83,7 @@ class StatusController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -109,7 +108,7 @@ class StatusController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll(); + $entities = $em->getRepository(Status::class)->findAll(); return $this->render('@ChillEvent/Status/index.html.twig', [ 'entities' => $entities, @@ -141,7 +140,7 @@ class StatusController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -164,7 +163,7 @@ class StatusController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index 71b07a123..db431c858 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -73,7 +73,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa ->findBy(['center' => $center]); $events = $this->createEvents($center, $manager); - /** @var \Chill\PersonBundle\Entity\Person $person */ + /** @var Person $person */ foreach ($people as $person) { $nb = random_int(0, 3); diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index c37566fe7..90c38743b 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -52,7 +52,7 @@ final class EventSearchTest extends WebTestCase /** * The eventSearch service, which is used to search events. * - * @var \Chill\EventBundle\Search\EventSearch + * @var EventSearch */ protected $eventSearch; diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index 7efb0c3b2..82b358239 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -31,9 +31,8 @@ abstract class AbstractCRUDController extends AbstractController * This configuration si defined by `chill_main['crud']` or `chill_main['apis']` */ protected array $crudConfig = []; - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} /** * get the role given from the config. diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php index ad28c4a1c..09abfa43d 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php @@ -23,9 +23,8 @@ use Symfony\Component\Validator\ConstraintViolationListInterface; class ApiController extends AbstractCRUDController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Base method for handling api action. * diff --git a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php index de4ddc7bd..b553db0f4 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php @@ -60,7 +60,6 @@ class CRUDRoutesLoader extends Loader /** * @param null $type - * */ public function supports($resource, $type = null): bool { diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index e5833e580..860f8c82e 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -83,7 +83,7 @@ class LoadAndUpdateLanguagesCommand extends Command $languages = []; foreach ($chillAvailableLanguages as $avLang) { - $languages[$avLang] = \Symfony\Component\Intl\Languages::getNames(); + $languages[$avLang] = Languages::getNames(); } foreach (Languages::getNames() as $code => $lang) { @@ -105,7 +105,7 @@ class LoadAndUpdateLanguagesCommand extends Command $languageDB = $em->getRepository(Language::class)->find($code); if (null === $languageDB) { - $languageDB = new \Chill\MainBundle\Entity\Language(); + $languageDB = new Language(); $languageDB->setId($code); $em->persist($languageDB); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index 92106d200..b6a9be75c 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -40,7 +40,7 @@ class LoadCountriesCommand extends Command $names[$language] = Countries::getName($code, $language); } - $country = new \Chill\MainBundle\Entity\Country(); + $country = new Country(); $country->setName($names)->setCountryCode($code); $countryEntities[] = $country; } diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index c38272d06..a83663ed0 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -36,7 +36,7 @@ class SetPasswordCommand extends Command public function _getUser($username) { return $this->entityManager - ->getRepository(\Chill\MainBundle\Entity\User::class) + ->getRepository(User::class) ->findOneBy(['username' => $username]); } diff --git a/src/Bundle/ChillMainBundle/Controller/AddressApiController.php b/src/Bundle/ChillMainBundle/Controller/AddressApiController.php index acc7f27c3..1f7abdb7a 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressApiController.php @@ -20,9 +20,8 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; class AddressApiController extends ApiController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Duplicate an existing address. * diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index d318fcc58..963e03322 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -70,7 +70,7 @@ class ExportController extends AbstractController */ public function downloadResultAction(Request $request, mixed $alias) { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $export = $exportManager->getExport($alias); $key = $request->query->get('key', null); @@ -108,13 +108,13 @@ class ExportController extends AbstractController * * @param string $alias * - * @return \Symfony\Component\HttpFoundation\Response + * @return Response * * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"}) */ public function generateAction(Request $request, $alias) { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $key = $request->query->get('key', null); $savedExport = $this->getSavedExportFromRequest($request); @@ -274,7 +274,7 @@ class ExportController extends AbstractController */ protected function createCreateFormExport(string $alias, string $step, array $data, ?SavedExport $savedExport): FormInterface { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $isGenerate = str_starts_with($step, 'generate_'); @@ -444,7 +444,7 @@ class ExportController extends AbstractController * * @param string $alias * - * @return \Symfony\Component\HttpFoundation\RedirectResponse + * @return RedirectResponse */ private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport) { @@ -452,7 +452,7 @@ class ExportController extends AbstractController $dataFormatter = $this->session->get('formatter_step_raw', null); $dataExport = $this->session->get('export_step_raw', null); - if (null === $dataFormatter && $export instanceof \Chill\MainBundle\Export\ExportInterface) { + if (null === $dataFormatter && $export instanceof ExportInterface) { return $this->redirectToRoute('chill_main_export_new', [ 'alias' => $alias, 'step' => $this->getNextStep('generate', $export, true), @@ -531,7 +531,7 @@ class ExportController extends AbstractController ]); } - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $form = $this->createCreateFormExport($alias, 'centers', [], $savedExport); @@ -620,11 +620,11 @@ class ExportController extends AbstractController return 'export'; case 'export': - if ($export instanceof \Chill\MainBundle\Export\ExportInterface) { + if ($export instanceof ExportInterface) { return $reverse ? 'centers' : 'formatter'; } - if ($export instanceof \Chill\MainBundle\Export\DirectExportInterface) { + if ($export instanceof DirectExportInterface) { return $reverse ? 'centers' : 'generate'; } diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeController.php b/src/Bundle/ChillMainBundle/Controller/ScopeController.php index b7e142e04..e6bcdce86 100644 --- a/src/Bundle/ChillMainBundle/Controller/ScopeController.php +++ b/src/Bundle/ChillMainBundle/Controller/ScopeController.php @@ -26,7 +26,8 @@ use Symfony\Component\HttpFoundation\Response; class ScopeController extends AbstractController { public function __construct( - private readonly EntityManagerInterface $entityManager, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry + private readonly EntityManagerInterface $entityManager, + private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry ) {} /** @@ -85,7 +86,7 @@ class ScopeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $entities = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->findAll(); + $entities = $em->getRepository(Scope::class)->findAll(); return $this->render('@ChillMain/Scope/index.html.twig', [ 'entities' => $entities, @@ -115,7 +116,7 @@ class ScopeController extends AbstractController { $em = $this->managerRegistry->getManager(); - $scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id); + $scope = $em->getRepository(Scope::class)->find($id); if (!$scope) { throw $this->createNotFoundException('Unable to find Scope entity.'); diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index e81e3d9dc..78dd5eaba 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -45,7 +45,7 @@ class SearchController extends AbstractController /** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */ $search = $this->searchProvider ->getHasAdvancedFormByName($name); - } catch (\Chill\MainBundle\Search\UnknowSearchNameException) { + } catch (UnknowSearchNameException) { throw $this->createNotFoundException('no advanced search for '."{$name}"); } diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index b68448da4..14e7a4856 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -58,7 +58,7 @@ class UserController extends CRUDController { $em = $this->managerRegistry->getManager(); - $user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid); + $user = $em->getRepository(User::class)->find($uid); if (!$user) { throw $this->createNotFoundException('Unable to find User entity.'); @@ -110,13 +110,13 @@ class UserController extends CRUDController { $em = $this->managerRegistry->getManager(); - $user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid); + $user = $em->getRepository(User::class)->find($uid); if (!$user) { throw $this->createNotFoundException('Unable to find User entity.'); } - $groupCenter = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class) + $groupCenter = $em->getRepository(GroupCenter::class) ->find($gcid); if (!$groupCenter) { @@ -434,7 +434,7 @@ class UserController extends CRUDController { $em = $this->managerRegistry->getManager(); - $groupCenterManaged = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class) + $groupCenterManaged = $em->getRepository(GroupCenter::class) ->findOneBy([ 'center' => $groupCenter->getCenter(), 'permissionsGroup' => $groupCenter->getPermissionsGroup(), diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 2590b549b..5c33ef1b3 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -570,7 +570,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\UserJob::class, + 'class' => UserJob::class, 'name' => 'user_job', 'base_path' => '/api/1.0/main/user-job', 'base_role' => 'ROLE_USER', @@ -634,7 +634,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Country::class, + 'class' => Country::class, 'name' => 'country', 'base_path' => '/api/1.0/main/country', 'base_role' => 'ROLE_USER', @@ -654,7 +654,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\User::class, + 'class' => User::class, 'controller' => \Chill\MainBundle\Controller\UserApiController::class, 'name' => 'user', 'base_path' => '/api/1.0/main/user', @@ -696,7 +696,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Location::class, + 'class' => Location::class, 'controller' => \Chill\MainBundle\Controller\LocationApiController::class, 'name' => 'location', 'base_path' => '/api/1.0/main/location', @@ -718,7 +718,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\LocationType::class, + 'class' => LocationType::class, 'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class, 'name' => 'location_type', 'base_path' => '/api/1.0/main/location-type', @@ -739,7 +739,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Civility::class, + 'class' => Civility::class, 'name' => 'civility', 'base_path' => '/api/1.0/main/civility', 'base_role' => 'ROLE_USER', diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index 501e28a9a..4a28267cd 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -73,8 +73,8 @@ class PermissionsGroup */ public function __construct() { - $this->roleScopes = new \Doctrine\Common\Collections\ArrayCollection(); - $this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection(); + $this->roleScopes = new ArrayCollection(); + $this->groupCenters = new ArrayCollection(); } public function addRoleScope(RoleScope $roleScope) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index d0debee73..f922defd1 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -189,7 +189,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter } /** - * @return \Chill\MainBundle\Entity\User + * @return User */ public function addGroupCenter(GroupCenter $groupCenter) { diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php index 97a37d455..853c177b7 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php @@ -100,7 +100,7 @@ class CSVListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php index 02b7409bc..8b32714cc 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php @@ -99,7 +99,7 @@ class CSVPivotedListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index e91095afd..7284ff70a 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -112,7 +112,7 @@ class SpreadsheetListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php index fcc4b4ec5..469b9c18e 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php +++ b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php @@ -83,7 +83,7 @@ trait AppendScopeChoiceTypeTrait { $resolver ->setRequired(['center', 'role']) - ->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class) + ->setAllowedTypes('center', Center::class) ->setAllowedTypes('role', 'string'); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php index 48bd37dcc..1f6e08571 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php @@ -23,10 +23,10 @@ class ComposedGroupCenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('permissionsgroup', EntityType::class, [ - 'class' => \Chill\MainBundle\Entity\PermissionsGroup::class, + 'class' => PermissionsGroup::class, 'choice_label' => static fn (PermissionsGroup $group) => $group->getName(), ])->add('center', EntityType::class, [ - 'class' => \Chill\MainBundle\Entity\Center::class, + 'class' => Center::class, 'choice_label' => static fn (Center $center) => $center->getName(), ]); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php index 39648c11a..e9ff503df 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php @@ -56,7 +56,7 @@ class Select2CountryType extends AbstractType asort($choices, \SORT_STRING | \SORT_FLAG_CASE); $resolver->setDefaults([ - 'class' => \Chill\MainBundle\Entity\Country::class, + 'class' => Country::class, 'choices' => array_combine(array_values($choices), array_keys($choices)), 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)), ]); diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php index bc25ac638..68a3970ba 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php @@ -52,7 +52,7 @@ class Select2LanguageType extends AbstractType asort($choices, \SORT_STRING | \SORT_FLAG_CASE); $resolver->setDefaults([ - 'class' => \Chill\MainBundle\Entity\Language::class, + 'class' => Language::class, 'choices' => array_combine(array_values($choices), array_keys($choices)), 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)), ]); diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 208af8522..3a3f1b8d3 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -38,7 +38,7 @@ class WorkflowStepType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - /** @var \Chill\MainBundle\Entity\Workflow\EntityWorkflow $entityWorkflow */ + /** @var EntityWorkflow $entityWorkflow */ $entityWorkflow = $options['entity_workflow']; $handler = $this->entityWorkflowManager->getHandler($entityWorkflow); $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); diff --git a/src/Bundle/ChillMainBundle/Pagination/Paginator.php b/src/Bundle/ChillMainBundle/Pagination/Paginator.php index a809bc9f4..34a405a20 100644 --- a/src/Bundle/ChillMainBundle/Pagination/Paginator.php +++ b/src/Bundle/ChillMainBundle/Pagination/Paginator.php @@ -137,7 +137,7 @@ class Paginator implements PaginatorInterface } /** - * @return \Chill\MainBundle\Pagination\Page + * @return Page * * @throws \RuntimeException if the next page does not exists */ diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php index 432beb7fa..8a094d00b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php @@ -43,7 +43,7 @@ class GeographicalUnitByAddressApiControllerTest extends WebTestCase $em = self::getContainer()->get(EntityManagerInterface::class); $nb = $em->createQuery('SELECT COUNT(a) FROM '.Address::class.' a')->getSingleScalarResult(); - /** @var \Chill\MainBundle\Entity\Address $random */ + /** @var Address $random */ $random = $em->createQuery('SELECT a FROM '.Address::class.' a') ->setFirstResult(random_int(0, $nb)) ->setMaxResults(1) diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 171472ccc..ada598072 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -58,7 +58,7 @@ final class ExportManagerTest extends KernelTestCase { self::bootKernel(); - $this->prophet = new \Prophecy\Prophet(); + $this->prophet = new Prophet(); } protected function tearDown(): void @@ -370,7 +370,7 @@ final class ExportManagerTest extends KernelTestCase $user = $this->prepareUser([]); $authorizationChecker = $this->prophet->prophesize(); - $authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class); + $authorizationChecker->willImplement(AuthorizationCheckerInterface::class); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center) ->willReturn(true); @@ -399,7 +399,7 @@ final class ExportManagerTest extends KernelTestCase $user = $this->prepareUser([]); $authorizationChecker = $this->prophet->prophesize(); - $authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class); + $authorizationChecker->willImplement(AuthorizationCheckerInterface::class); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center) ->willReturn(true); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $centerB) @@ -435,7 +435,7 @@ final class ExportManagerTest extends KernelTestCase ); $export = $this->prophet->prophesize(); - $export->willImplement(\Chill\MainBundle\Export\ExportInterface::class); + $export->willImplement(ExportInterface::class); $export->requiredRole()->willReturn('CHILL_STAT_DUMMY'); $result = $exportManager->isGrantedForElement($export->reveal(), null, []); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index d95305f8c..c445a0014 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -258,8 +258,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($center); $entity->getScope()->willReturn($scope); @@ -383,7 +383,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertTrue($helper->userHasAccess( @@ -407,7 +407,7 @@ final class AuthorizationHelperTest extends KernelTestCase $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertTrue($helper->userHasAccess( @@ -431,8 +431,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($centerB); $entity->getScope()->willReturn($scope); @@ -452,7 +452,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE')); @@ -471,8 +471,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($center); $entity->getScope()->willReturn($scope); @@ -503,7 +503,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($centerA); $this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE')); @@ -577,7 +577,7 @@ final class AuthorizationHelperTest extends KernelTestCase } /** - * @return \Chill\MainBundle\Security\Authorization\AuthorizationHelper + * @return AuthorizationHelper */ private function getAuthorizationHelper() { diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php index 4c7a7f6fa..b2d9d5f29 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php @@ -23,9 +23,8 @@ use Symfony\Component\HttpFoundation\Response; */ class EntityPersonCRUDController extends CRUDController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * Override the base method to add a filtering step to a person. * diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php index c01bd148a..55b788cc2 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php @@ -20,9 +20,8 @@ use Symfony\Component\HttpFoundation\Response; class OneToOneEntityPersonCRUDController extends CRUDController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + protected function generateRedirectOnCreateRoute($action, Request $request, $entity): string { throw new \BadMethodCallException('Not implemented yet.'); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 728328400..591742ee9 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -224,7 +224,7 @@ final class AccompanyingCourseWorkController extends AbstractController if (1 < count($types)) { $filterBuilder - ->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', \Chill\PersonBundle\Entity\SocialWork\SocialAction::class, $types, [ + ->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', SocialAction::class, $types, [ 'choice_label' => fn (SocialAction $sa) => $this->translatableStringHelper->localize($sa->getTitle()), ]); } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index cd0abd873..ed86f02e5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -432,7 +432,7 @@ class AccompanyingPeriodController extends AbstractController private function _getPerson(int $id): Person { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($id); + ->getRepository(Person::class)->find($id); if (null === $person) { throw $this->createNotFoundException('Person not found'); diff --git a/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php index b903ffb61..0cea8d1f2 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php @@ -21,9 +21,8 @@ use Symfony\Component\HttpFoundation\Request; */ class ClosingMotiveController extends CRUDController { - public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) - { - } + public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + /** * @param string $action */ diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php index bcb5c8ccd..b1df6cb16 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php @@ -37,7 +37,7 @@ class PersonAddressController extends AbstractController public function createAction(mixed $person_id, Request $request) { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -94,7 +94,7 @@ class PersonAddressController extends AbstractController public function editAction(mixed $person_id, mixed $address_id) { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -124,7 +124,7 @@ class PersonAddressController extends AbstractController public function listAction(mixed $person_id) { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -148,7 +148,7 @@ class PersonAddressController extends AbstractController public function newAction(mixed $person_id) { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -177,7 +177,7 @@ class PersonAddressController extends AbstractController public function updateAction(mixed $person_id, mixed $address_id, Request $request) { $person = $this->managerRegistry->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index f9c24d2d4..3d8d1bdbe 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -106,7 +106,7 @@ final class PersonController extends AbstractController $cFGroup = null; $cFDefaultGroup = $this->em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class) - ->findOneByEntity(\Chill\PersonBundle\Entity\Person::class); + ->findOneByEntity(Person::class); if ($cFDefaultGroup) { $cFGroup = $cFDefaultGroup->getCustomFieldsGroup(); @@ -281,7 +281,7 @@ final class PersonController extends AbstractController /** * easy getting a person by his id. * - * @return \Chill\PersonBundle\Entity\Person + * @return Person */ private function _getPerson(int $id) { diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index c5d7a026b..18861e01f 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -401,16 +401,16 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'apis' => [ [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod::class, + 'class' => AccompanyingPeriod::class, 'name' => 'accompanying_course', 'base_path' => '/api/1.0/person/accompanying-course', 'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseApiController::class, 'actions' => [ '_entity' => [ 'roles' => [ - Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_GET => AccompanyingPeriodVoter::SEE, + Request::METHOD_PATCH => AccompanyingPeriodVoter::SEE, + Request::METHOD_PUT => AccompanyingPeriodVoter::SEE, ], 'methods' => [ Request::METHOD_GET => true, @@ -426,8 +426,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'resource' => [ @@ -438,8 +438,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'comment' => [ @@ -450,8 +450,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'requestor' => [ @@ -462,8 +462,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'scope' => [ @@ -474,8 +474,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'socialissue' => [ @@ -487,8 +487,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'controller_action' => 'socialIssueApi', 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'work' => [ @@ -500,7 +500,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'controller_action' => 'workApi', 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE => 'ALWAYS_FAILS', ], ], @@ -511,7 +511,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, ], ], // 'confidential' => [ @@ -618,7 +618,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'class' => \Chill\PersonBundle\Entity\Person::class, 'name' => 'person', 'base_path' => '/api/1.0/person/person', - 'base_role' => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, + 'base_role' => PersonVoter::SEE, 'controller' => \Chill\PersonBundle\Controller\PersonApiController::class, 'actions' => [ '_entity' => [ @@ -629,10 +629,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_PATCH => true, ], 'roles' => [ - Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, - Request::METHOD_HEAD => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, - Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, + Request::METHOD_GET => PersonVoter::SEE, + Request::METHOD_HEAD => PersonVoter::SEE, + Request::METHOD_POST => PersonVoter::CREATE, + Request::METHOD_PATCH => PersonVoter::CREATE, ], ], 'address' => [ @@ -1001,7 +1001,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'property' => 'step', ], 'supports' => [ - \Chill\PersonBundle\Entity\AccompanyingPeriod::class, + AccompanyingPeriod::class, ], 'initial_marking' => 'DRAFT', 'places' => [ diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 57c1a0314..db06be0f4 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -532,7 +532,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI */ public function __construct() { - $this->calendars = new \Doctrine\Common\Collections\ArrayCollection(); + $this->calendars = new ArrayCollection(); $this->accompanyingPeriodParticipations = new ArrayCollection(); $this->spokenLanguages = new ArrayCollection(); $this->addresses = new ArrayCollection(); diff --git a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php index b820aa86f..2016fb80a 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php @@ -29,13 +29,13 @@ class Select2MaritalStatusType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - $transformer = new ObjectToIdTransformer($this->em, \Chill\PersonBundle\Entity\MaritalStatus::class); + $transformer = new ObjectToIdTransformer($this->em, MaritalStatus::class); $builder->addModelTransformer($transformer); } public function configureOptions(OptionsResolver $resolver) { - $maritalStatuses = $this->em->getRepository(\Chill\PersonBundle\Entity\MaritalStatus::class)->findAll(); + $maritalStatuses = $this->em->getRepository(MaritalStatus::class)->findAll(); $choices = []; foreach ($maritalStatuses as $ms) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php index 14c6e30fa..b62c06489 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php @@ -196,7 +196,7 @@ final class PersonAddressControllerTest extends WebTestCase */ protected function refreshPerson() { - self::$person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + self::$person = $this->em->getRepository(Person::class) ->find(self::$person->getId()); } } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 9c79c74e0..e47800cdb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -89,7 +89,7 @@ final class PersonControllerCreateTest extends WebTestCase $form = $crawler->selectButton("Créer l'usager")->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $form, 'The page contains a button' ); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php index d23fbcb7a..a89f5adc7 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php @@ -205,7 +205,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase */ protected function refreshPerson() { - $this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $this->person = $this->em->getRepository(Person::class) ->find($this->person->getId()); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php index e0d56204f..3fbbf667b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php @@ -98,7 +98,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase */ protected function refreshPerson() { - $this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $this->person = $this->em->getRepository(Person::class) ->find($this->person->getId()); } } diff --git a/src/Bundle/ChillReportBundle/Controller/ReportController.php b/src/Bundle/ChillReportBundle/Controller/ReportController.php index 7b341e440..13c16672b 100644 --- a/src/Bundle/ChillReportBundle/Controller/ReportController.php +++ b/src/Bundle/ChillReportBundle/Controller/ReportController.php @@ -57,7 +57,7 @@ class ReportController extends AbstractController $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) ->find($cf_group_id); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $person = $em->getRepository(Person::class) ->find($person_id); if (null === $person || null === $cFGroup) { @@ -183,7 +183,7 @@ class ReportController extends AbstractController { $em = $this->managerRegistry->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); @@ -240,7 +240,7 @@ class ReportController extends AbstractController { $em = $this->managerRegistry->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $cFGroup = $em ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) ->find($cf_group_id); @@ -288,7 +288,7 @@ class ReportController extends AbstractController { $em = $this->managerRegistry->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $person = $em->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -310,7 +310,7 @@ class ReportController extends AbstractController } $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) - ->findByEntity(\Chill\ReportBundle\Entity\Report::class); + ->findByEntity(Report::class); if (1 === \count($cFGroups)) { return $this->redirectToRoute('report_new', ['person_id' => $person_id, 'cf_group_id' => $cFGroups[0]->getId()]); @@ -332,7 +332,7 @@ class ReportController extends AbstractController ]) ->getForm(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); return $this->render('@ChillReport/Report/select_report_type.html.twig', [ 'form' => $form->createView(), @@ -359,7 +359,7 @@ class ReportController extends AbstractController $em = $this->managerRegistry->getManager(); $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) - ->findByEntity(\Chill\ReportBundle\Entity\Report::class); + ->findByEntity(Report::class); if (1 === \count($cFGroups)) { return $this->redirectToRoute('report_export_list', ['cf_group_id' => $cFGroups[0]->getId()]); @@ -459,7 +459,7 @@ class ReportController extends AbstractController { $em = $this->managerRegistry->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $entity = $em->getRepository('ChillReportBundle:Report')->find($report_id); diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php index a16653601..d91583dc0 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php @@ -43,7 +43,7 @@ final class ReportControllerNextTest extends WebTestCase ->get('doctrine.orm.entity_manager'); $this->person = $em - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->findOneBy( [ 'lastName' => 'Charline', @@ -58,7 +58,7 @@ final class ReportControllerNextTest extends WebTestCase // get custom fields group from fixture $customFieldsGroups = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]); // filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index 1259e4b5f..e5270c038 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -43,7 +43,7 @@ final class ReportControllerTest extends WebTestCase private static $group; /** - * @var \Chill\PersonBundle\Entity\Person + * @var Person */ private static $person; @@ -59,7 +59,7 @@ final class ReportControllerTest extends WebTestCase // get a random person self::$person = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->findOneBy( [ 'lastName' => 'Charline', @@ -73,7 +73,7 @@ final class ReportControllerTest extends WebTestCase $customFieldsGroups = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]); // filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( @@ -123,7 +123,7 @@ final class ReportControllerTest extends WebTestCase $form = $crawlerAddAReportPage->selectButton('Créer un nouveau rapport')->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $form, 'I can see a form with a button "add a new report" ' ); @@ -242,7 +242,7 @@ final class ReportControllerTest extends WebTestCase $link = $crawlerPersonPage->selectLink("AJOUT D'UN RAPPORT")->link(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Link::class, + Link::class, $link, 'There is a "add a report" link in menu' ); @@ -270,7 +270,7 @@ final class ReportControllerTest extends WebTestCase ->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $addForm, 'I have a report form' ); diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index 6e7a6dad1..ad6a16e57 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -58,7 +58,7 @@ final class TimelineProviderTest extends WebTestCase $scopesSocial = array_filter( self::$em - ->getRepository(\Chill\MainBundle\Entity\Scope::class) + ->getRepository(Scope::class) ->findAll(), static fn (Scope $scope) => 'social' === $scope->getName()['en'] ); diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index af517cda2..200a8fbac 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -636,7 +636,7 @@ final class SingleTaskController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ protected function setCreateForm(SingleTask $task, string $role) { diff --git a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php index eca0c17cc..91dfeaf61 100644 --- a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php @@ -103,9 +103,6 @@ class SingleTask extends AbstractTask private Collection $taskPlaceEvents; /** - * @var \DateInterval - * and this.getEndDate() === null - * * @ORM\Column(name="warning_interval", type="dateinterval", nullable=true) * * @Serializer\Groups({"read"}) diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 91625c827..cff064edc 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -127,7 +127,7 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], 'apis' => [ [ - 'class' => \Chill\ThirdPartyBundle\Entity\ThirdParty::class, + 'class' => ThirdParty::class, 'name' => 'thirdparty', 'base_path' => '/api/1.0/thirdparty/thirdparty', // 'base_role' => \Chill\ThirdPartyBundle\Security\Authorization\ThirdPartyVoter::SHOW, @@ -142,11 +142,11 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte Request::METHOD_PATCH => true, ], 'roles' => [ - Request::METHOD_GET => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, - Request::METHOD_HEAD => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, - Request::METHOD_POST => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, - Request::METHOD_PUT => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, - Request::METHOD_PATCH => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, + Request::METHOD_GET => ThirdPartyVoter::SHOW, + Request::METHOD_HEAD => ThirdPartyVoter::SHOW, + Request::METHOD_POST => ThirdPartyVoter::CREATE, + Request::METHOD_PUT => ThirdPartyVoter::CREATE, + Request::METHOD_PATCH => ThirdPartyVoter::CREATE, ], ], ], diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index f4ad5293c..9552343f6 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -149,7 +149,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @ORM\JoinTable(name="chill_3party.party_center") */ - private Collection $centers; + private readonly Collection $centers; /** * Contact Persons: One Institutional ThirdParty has Many Contact Persons. diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 41e0140c8..046d553e9 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -100,7 +100,7 @@ class ThirdPartyType extends AbstractType 'label' => 'thirdparty.Contact data are confidential', ]); - // Institutional ThirdParty (parent) + // Institutional ThirdParty (parent) } else { $builder ->add('nameCompany', TextType::class, [ diff --git a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php index 141799207..2272c9efd 100644 --- a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php +++ b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php @@ -19,5 +19,5 @@ return static function (RoutingConfigurator $routes) { $routes ->add('chill_wopi_object_convert', '/convert/{uuid}') - ->controller(\Chill\WopiBundle\Controller\Convert::class); + ->controller(Chill\WopiBundle\Controller\Convert::class); }; diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php index 89ec65f14..c4178c04b 100644 --- a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php +++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php @@ -10,5 +10,5 @@ declare(strict_types=1); */ return static function (Rector\Config\RectorConfig $rectorConfig): void { - $rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class); + $rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class); };