From e8690d249fff6acac5b02054daff7833cc2ec893 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jul 2023 10:42:46 +0200 Subject: [PATCH 01/91] FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted --- .../ChillPersonBundle/Actions/Remove/PersonMove.php | 10 ++++++++-- .../views/PersonDuplicate/_sidepane.html.twig | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 4e2f7468e..76a6f5b8d 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -133,8 +133,14 @@ class PersonMove $conditions = []; - foreach ($mapping['joinColumns'] as $columns) { - $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + if (array_key_exists('joinTable', $mapping)) { + foreach ($mapping['joinTable']['joinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['referencedColumnName'], $from->getId()); + } + } elseif (array_key_exists('joinColumns', $mapping)) { + foreach ($mapping['joinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + } } return sprintf( diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig index 1e770062a..b8edcc437 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig @@ -4,7 +4,7 @@
  • {{ 'gender'|trans }}: {{ person.gender|trans }}
  • {{ 'maritalStatus'|trans }}: - {% if person.maritalStatus.name %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}
  • + {% if person.maritalStatus %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}
  • {{ 'birthdate'|trans }}: {% if person.birthdate is not null %}{{ person.birthdate|format_date('short') }}{% endif %}
  • {{ 'placeOfBirth'|trans }}: From d825a8509bcf8aaf0df4037231c167495c6f3a41 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jul 2023 10:42:46 +0200 Subject: [PATCH 02/91] FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted --- .../ChillPersonBundle/Actions/Remove/PersonMove.php | 10 ++++++++-- .../views/PersonDuplicate/_sidepane.html.twig | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 4e2f7468e..76a6f5b8d 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -133,8 +133,14 @@ class PersonMove $conditions = []; - foreach ($mapping['joinColumns'] as $columns) { - $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + if (array_key_exists('joinTable', $mapping)) { + foreach ($mapping['joinTable']['joinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['referencedColumnName'], $from->getId()); + } + } elseif (array_key_exists('joinColumns', $mapping)) { + foreach ($mapping['joinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + } } return sprintf( diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig index 1e770062a..b8edcc437 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig @@ -4,7 +4,7 @@
  • {{ 'gender'|trans }}: {{ person.gender|trans }}
  • {{ 'maritalStatus'|trans }}: - {% if person.maritalStatus.name %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}
  • + {% if person.maritalStatus %}{{ person.maritalStatus.name|localize_translatable_string }}{% endif %}
  • {{ 'birthdate'|trans }}: {% if person.birthdate is not null %}{{ person.birthdate|format_date('short') }}{% endif %}
  • {{ 'placeOfBirth'|trans }}: From fcd4c3b92eef7963b6ce0d1096648852ccbec88a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jul 2023 11:12:22 +0200 Subject: [PATCH 03/91] DX add changie --- .changes/unreleased/Fixed-20230712-111206.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/unreleased/Fixed-20230712-111206.yaml diff --git a/.changes/unreleased/Fixed-20230712-111206.yaml b/.changes/unreleased/Fixed-20230712-111206.yaml new file mode 100644 index 000000000..7bec6095e --- /dev/null +++ b/.changes/unreleased/Fixed-20230712-111206.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: reinstate the fusion of duplicate persons +time: 2023-07-12T11:12:06.673925762+02:00 +custom: + Issue: "107" From 04235409769d55a3b5277e23b6c1f2e31a184218 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jul 2023 11:17:25 +0200 Subject: [PATCH 04/91] FIX [duplicate][personpicker] use dynamic person picker to assign duplicate manually --- .../Form/PersonFindManuallyDuplicateType.php | 4 ++-- .../views/PersonDuplicate/find_manually.html.twig | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php b/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php index b9dfad240..1d7697332 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form; -use Chill\PersonBundle\Form\Type\PickPersonType; +use Chill\PersonBundle\Form\Type\PickPersonDynamicType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; @@ -21,7 +21,7 @@ class PersonFindManuallyDuplicateType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('person', PickPersonType::class, [ + ->add('person', PickPersonDynamicType::class, [ 'label' => 'Find duplicate', 'mapped' => false, ]) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/find_manually.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/find_manually.html.twig index 8769ae6da..982690f00 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/find_manually.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/find_manually.html.twig @@ -8,9 +8,9 @@ {% block content %}
    - +

    {{ 'Désigner un dossier doublon'|trans }}

    - + {{ form_start(form) }} {{ form_rest(form) }} @@ -29,3 +29,11 @@
    {% endblock %} + +{% block js %} + {{ encore_entry_script_tags('mod_pickentity_type') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_pickentity_type') }} +{% endblock %} From e0cdf06e9987eb9ff1d7c853497d327a7b55b1a8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jul 2023 15:30:33 +0200 Subject: [PATCH 05/91] FIX [duplicate] adding test and handlers to handle fusion of doublons with special cases - after codewithme session --- ...AccompanyingPeriodParticipationHandler.php | 35 +++++ .../PersonMoveCenterHistoryHandler.php | 45 ++++++ .../Handler/PersonMoveHouseholdHandler.php | 38 +++++ .../Actions/Remove/PersonMove.php | 69 +++++---- .../Actions/Remove/PersonMoveManager.php | 48 ++++++ .../Remove/PersonMoveSqlHandlerInterface.php | 19 +++ .../ChillPersonBundle/ChillPersonBundle.php | 3 + .../Tests/Action/Remove/PersonMoveTest.php | 138 ++++++++++++++++++ .../config/services/actions.yaml | 14 +- 9 files changed, 377 insertions(+), 32 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php new file mode 100644 index 000000000..83d8f201a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -0,0 +1,35 @@ +getId(), $from->getId(), $to->getId()); + + $deleteSql = sprintf(<<getId()); + + return [$sqlInsert, $deleteSql]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php new file mode 100644 index 000000000..25767d175 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -0,0 +1,45 @@ +getId(), $from->getId(), $to->getId()); + + $updateSql = sprintf(<<getId()); + } + +} diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php new file mode 100644 index 000000000..07035f569 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php @@ -0,0 +1,38 @@ +getId(), $from->getId(), $to->getId()); + + $deleteSql = sprintf(<<getId()); + + return [$sqlInsert, $deleteSql]; + } + +} diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 76a6f5b8d..b0530d6c3 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -35,22 +35,11 @@ use function in_array; */ class PersonMove { - /** - * @var EntityManagerInterface - */ - protected $em; - - /** - * @var EventDispatcherInterface - */ - protected $eventDispatcher; - public function __construct( - EntityManagerInterface $em, - EventDispatcherInterface $eventDispatcher + private EntityManagerInterface $em, + private PersonMoveManager $personMoveManager, + private EventDispatcherInterface $eventDispatcher ) { - $this->em = $em; - $this->eventDispatcher = $eventDispatcher; } /** @@ -88,9 +77,16 @@ class PersonMove } foreach ($metadata->getAssociationMappings() as $field => $mapping) { + + if ($this->personMoveManager->hasHandler($metadata->getName(), $field)) { + $sqls = array_merge($sqls, $this->personMoveManager->getSqls($metadata->getName(), $field, $from, $to)); + continue; + } + if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities(), true)) { continue; } + if (Person::class === $mapping['targetEntity'] and true === $mapping['isOwningSide']) { if (in_array($mapping['sourceEntity'], $toDelete, true)) { $sql = $this->createDeleteSQL($metadata, $from, $field); @@ -101,18 +97,10 @@ class PersonMove ['to' => $to->getId(), 'original_action' => 'move'] ); $this->eventDispatcher->dispatch(ActionEvent::DELETE, $event); + $sqls = array_merge($sqls, $event->getPreSql(), [$event->getSqlStatement()], $event->getPostSql()); } else { - $sql = $this->createMoveSQL($metadata, $from, $to, $field); - $event = new ActionEvent( - $from->getId(), - $metadata->getName(), - $sql, - ['to' => $to->getId(), 'original_action' => 'move'] - ); - $this->eventDispatcher->dispatch(ActionEvent::MOVE, $event); + $sqls = array_merge($sqls, $this->createMoveSQLs($metadata, $from, $to, $field)); } - - $sqls = array_merge($sqls, $event->getPreSql(), [$event->getSqlStatement()], $event->getPostSql()); } } } @@ -150,7 +138,7 @@ class PersonMove ); } - private function createMoveSQL(ClassMetadata $metadata, Person $from, Person $to, $field): string + private function createMoveSQLs($metadata, Person $from, Person $to, $field): array { $mapping = $metadata->getAssociationMapping($field); @@ -160,9 +148,34 @@ class PersonMove $tableName = ''; if (array_key_exists('joinTable', $mapping)) { + // there is a join_table: we have to find conflict $tableName = (null !== ($mapping['joinTable']['schema'] ?? null) ? $mapping['joinTable']['schema'] . '.' : '') . $mapping['joinTable']['name']; + $sqlInsert = sprintf( + "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $to->getId(), + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + + ); + $deleteSql = sprintf( + "DELETE FROM %s WHERE %s = %d", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + + ); + + return [ + $sqlInsert, $deleteSql + ]; + foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); } @@ -176,18 +189,17 @@ class PersonMove $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); } - foreach ($mapping['joinColumns'] as $columns) { $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); } } - return sprintf( + return [sprintf( 'UPDATE %s SET %s WHERE %s', $tableName, implode(' ', $sets), implode(' AND ', $conditions) - ); + )]; } /** @@ -198,7 +210,6 @@ class PersonMove { return [ Person\PersonCenterHistory::class, - HouseholdMember::class, AccompanyingPeriodParticipation::class, AccompanyingPeriod\AccompanyingPeriodWork::class, Relationship::class diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php new file mode 100644 index 000000000..a7bd1188a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php @@ -0,0 +1,48 @@ + + */ + private iterable $handlers, + ) + { + } + + /** + * @param class-string $className + * @param string $field + * @return bool + */ + public function hasHandler(string $className, string $field): bool + { + foreach ($this->handlers as $handler) { + if ($handler->supports($className, $field)) { + return true; + } + } + + return false; + } + + /** + * @param class-string $className + * @return array + */ + public function getSqls(string $className, string $field, Person $from, Person $to): array + { + foreach ($this->handlers as $handler) { + if ($handler->supports($className, $field)) { + return $handler->getSqls($className, $field, $from, $to); + } + } + return []; + } + +} diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php new file mode 100644 index 000000000..9958f59df --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php @@ -0,0 +1,19 @@ + + */ + public function getSqls(string $className, string $field, Person $from, Person $to): array; +} diff --git a/src/Bundle/ChillPersonBundle/ChillPersonBundle.php b/src/Bundle/ChillPersonBundle/ChillPersonBundle.php index 4233a7914..43c38aa36 100644 --- a/src/Bundle/ChillPersonBundle/ChillPersonBundle.php +++ b/src/Bundle/ChillPersonBundle/ChillPersonBundle.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle; +use Chill\PersonBundle\Actions\Remove\PersonMoveSqlHandlerInterface; use Chill\PersonBundle\DependencyInjection\CompilerPass\AccompanyingPeriodTimelineCompilerPass; use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface; use Chill\PersonBundle\Widget\PersonListWidgetFactory; @@ -29,5 +30,7 @@ class ChillPersonBundle extends Bundle $container->addCompilerPass(new AccompanyingPeriodTimelineCompilerPass()); $container->registerForAutoconfiguration(AccompanyingPeriodInfoUnionQueryPartInterface::class) ->addTag('chill_person.accompanying_period_info_part'); + $container->registerForAutoconfiguration(PersonMoveSqlHandlerInterface::class) + ->addTag('chill_person.person_move_handler'); } } diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php new file mode 100644 index 000000000..88869bf7d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -0,0 +1,138 @@ + + */ + private static $entitiesToDelete = []; + + public function setUp(): void + { + self::bootKernel(); + $this->em = self::$container->get(EntityManagerInterface::class); + $this->personMoveManager = self::$container->get(PersonMoveManager::class); + $this->eventDispatcher = self::$container->get(EventDispatcherInterface::class); + } + + public static function tearDownAfterClass(): void + { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); + + foreach (self::$entitiesToDelete as list($class, $id)) { + $entity = $em->find($class, $id); + + if (null !== $entity) { + $em->remove($entity); + } + } + + $em->flush(); + } + + /** + * @dataProvider dataProviderMovePerson + */ + public function testMovePerson(Person $personA, Person $personB, string $message): void + { + $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); + $sqls = $move->getSQL($personA, $personB); + //$conn = $this->em->getConnection(); + $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { + foreach ($sqls as $sql) { + $conn->executeStatement($sql); + } + }); + + $personA = $this->em->find(Person::class, $personA->getId()); + $personB = $this->em->find(Person::class, $personB->getId()); + + self::assertNull($personA?->getId(), $message); + self::assertNotNull($personB?->getId(), $message); + } + + public function dataProviderMovePerson(): iterable + { + $this->setUp(); + + $personA = new Person(); + $personB = new Person(); + + $this->em->persist($personA); + $this->em->persist($personB); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + + yield [$personA, $personB, "move 2 people without any associated data"]; + + $personA = new Person(); + $personB = new Person(); + + $activity = new Activity(); + $activity->setDate(new \DateTime('today')); + $activity->addPerson($personA); + $activity->addPerson($personB); + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($activity); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [Activity::class, $activity]; + + yield [$personA, $personB, "move 2 people having an activity"]; + + $personA = new Person(); + $personB = new Person(); + $household = new Household(); + $household->addMember( + $memberA = (new HouseholdMember())->setPerson($personA)->setShareHousehold(true) + ->setStartDate(new \DateTimeImmutable('2023-01-01')) + ); + $household->addMember( + $memberB = (new HouseholdMember())->setPerson($personB)->setShareHousehold(true) + ->setStartDate(new \DateTimeImmutable('2023-01-01')) + ); + + + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($household); + $this->em->persist($memberA); + $this->em->persist($memberB); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [HouseholdMember::class, $memberA]; + self::$entitiesToDelete[] = [HouseholdMember::class, $memberB]; + self::$entitiesToDelete[] = [Household::class, $household]; + + yield [$personA, $personB, "move 2 people having the same household at the same time"]; + + $this->em->flush(); + $this->em->clear(); + } +} diff --git a/src/Bundle/ChillPersonBundle/config/services/actions.yaml b/src/Bundle/ChillPersonBundle/config/services/actions.yaml index e4c6c6621..d6e2c80a5 100644 --- a/src/Bundle/ChillPersonBundle/config/services/actions.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/actions.yaml @@ -1,5 +1,13 @@ services: - Chill\PersonBundle\Actions\Remove\PersonMove: + _defaults: + autowire: true + autoconfigure: true + + Chill\PersonBundle\Actions\Remove\PersonMove: ~ + + Chill\PersonBundle\Actions\Remove\PersonMoveManager: arguments: - $em: '@Doctrine\ORM\EntityManagerInterface' - $eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface' \ No newline at end of file + $handlers: !tagged_iterator chill_person.person_move_handler + + Chill\PersonBundle\Actions\Remove\Handler\: + resource: '../../Actions/Remove/Handler' From 860e076b89bf052f4b6a26bad155268b2d361a53 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jul 2023 16:18:39 +0200 Subject: [PATCH 06/91] [test] add dataprovider for testing move person where both are participating in the same parcours --- .../PersonMoveCenterHistoryHandler.php | 45 ------------------- .../Tests/Action/Remove/PersonMoveTest.php | 19 ++++++++ 2 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php deleted file mode 100644 index 25767d175..000000000 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ /dev/null @@ -1,45 +0,0 @@ -getId(), $from->getId(), $to->getId()); - - $updateSql = sprintf(<<getId()); - } - -} diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 88869bf7d..1a49783c8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -5,6 +5,8 @@ namespace Action\Remove; use Chill\ActivityBundle\Entity\Activity; use Chill\PersonBundle\Actions\Remove\PersonMove; use Chill\PersonBundle\Actions\Remove\PersonMoveManager; +use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Household\HouseholdMember; use Chill\PersonBundle\Entity\Person; @@ -132,6 +134,23 @@ class PersonMoveTest extends KernelTestCase yield [$personA, $personB, "move 2 people having the same household at the same time"]; + $personA = new Person(); + $personB = new Person(); + $parcours = new AccompanyingPeriod(); + + $parcours->addPerson($personA); + $parcours->addPerson($personB); + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($parcours); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [AccompanyingPeriod::class, $parcours]; + + yield [$personA, $personB, "move 2 people participating to the same parcours"]; + $this->em->flush(); $this->em->clear(); } From bb187f5463681493707eb3129a37884debaaa1ee Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 17 Jul 2023 07:50:10 +0200 Subject: [PATCH 07/91] WIP started center_history query for duplicate person merge --- ...AccompanyingPeriodParticipationHandler.php | 9 ++-- .../PersonMoveCenterHistoryHandler.php | 45 +++++++++++++++++ .../Actions/Remove/PersonMove.php | 49 +++++++++---------- .../Tests/Action/Remove/PersonMoveTest.php | 9 ++-- 4 files changed, 79 insertions(+), 33 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index 83d8f201a..5acd67126 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -2,9 +2,11 @@ namespace Chill\PersonBundle\Actions\Remove\Handler; +use Chill\PersonBundle\Actions\Remove\PersonMoveSqlHandlerInterface; use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; +use Chill\PersonBundle\Entity\Person; -class PersonMoveAccompanyingPeriodParticipationHandler +class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlHandlerInterface { public function supports(string $className, string $field): bool { @@ -13,6 +15,7 @@ class PersonMoveAccompanyingPeriodParticipationHandler public function getSqls(string $className, string $field, Person $from, Person $to): array { + var_dump(__METHOD__); $insertSql = sprintf(<<getId(), $from->getId(), $to->getId()); @@ -30,6 +33,6 @@ class PersonMoveAccompanyingPeriodParticipationHandler DELETE FROM chill_person_accompanying_period_participation WHERE person_id = %d SQL, $from->getId()); - return [$sqlInsert, $deleteSql]; + return [$insertSql, $deleteSql]; } } diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php new file mode 100644 index 000000000..25767d175 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -0,0 +1,45 @@ +getId(), $from->getId(), $to->getId()); + + $updateSql = sprintf(<<getId()); + } + +} diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index b0530d6c3..ecf17d3b4 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -78,9 +78,9 @@ class PersonMove foreach ($metadata->getAssociationMappings() as $field => $mapping) { - if ($this->personMoveManager->hasHandler($metadata->getName(), $field)) { - $sqls = array_merge($sqls, $this->personMoveManager->getSqls($metadata->getName(), $field, $from, $to)); - continue; + if ($this->personMoveManager->hasHandler($metadata->getName(), $field)) { + $sqls = array_merge($sqls, $this->personMoveManager->getSqls($metadata->getName(), $field, $from, $to)); + continue; } if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities(), true)) { @@ -152,29 +152,28 @@ class PersonMove $tableName = (null !== ($mapping['joinTable']['schema'] ?? null) ? $mapping['joinTable']['schema'] . '.' : '') . $mapping['joinTable']['name']; - $sqlInsert = sprintf( - "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id - $to->getId(), - $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $from->getId() + $sqlInsert = sprintf( + "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $to->getId(), + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + ); - ); - $deleteSql = sprintf( - "DELETE FROM %s WHERE %s = %d", - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $from->getId() + $deleteSql = sprintf( + "DELETE FROM %s WHERE %s = %d", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + ); - ); - - return [ - $sqlInsert, $deleteSql - ]; + return [ + $sqlInsert, $deleteSql + ]; foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); @@ -183,6 +182,7 @@ class PersonMove foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); } + } elseif (array_key_exists('joinColumns', $mapping)) { $tableName = $this->getTableName($metadata); foreach ($mapping['joinColumns'] as $columns) { @@ -210,7 +210,6 @@ class PersonMove { return [ Person\PersonCenterHistory::class, - AccompanyingPeriodParticipation::class, AccompanyingPeriod\AccompanyingPeriodWork::class, Relationship::class ]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 1a49783c8..05fc98aa6 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -59,12 +59,13 @@ class PersonMoveTest extends KernelTestCase { $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); - //$conn = $this->em->getConnection(); - $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { + $conn = $this->em->getConnection(); +// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { +// var_dump($sql); $conn->executeStatement($sql); } - }); +// }); $personA = $this->em->find(Person::class, $personA->getId()); $personB = $this->em->find(Person::class, $personB->getId()); @@ -118,8 +119,6 @@ class PersonMoveTest extends KernelTestCase ->setStartDate(new \DateTimeImmutable('2023-01-01')) ); - - $this->em->persist($personA); $this->em->persist($personB); $this->em->persist($household); From f02d97ddb093c523e9a5be52bd08c177d82a9cc2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 27 Jul 2023 10:18:11 +0200 Subject: [PATCH 08/91] FEATURE [centerHistory] attempt to complete test for centerHistory --- ...AccompanyingPeriodParticipationHandler.php | 1 - .../PersonMoveCenterHistoryHandler.php | 59 +++++++++++-------- .../Tests/Action/Remove/PersonMoveTest.php | 52 +++++++++++++++- 3 files changed, 87 insertions(+), 25 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index 5acd67126..e164dcaf8 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -15,7 +15,6 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH public function getSqls(string $className, string $field, Person $from, Person $to): array { - var_dump(__METHOD__); $insertSql = sprintf(<<getId(), $from->getId(), $to->getId()); + $sqlStatements = []; - $updateSql = sprintf(<<em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $from->getId()]); +// $centerHistoriesA = $from->getCenterHistory()->toArray(); +// var_dump($centerHistoriesA); + $datesArrayA = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesA); + if (!count($datesArrayA) === 0) { + $oldestDateA = min($datesArrayA); + } + $centerHistoriesB = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $to->getId()]); +// $centerHistoriesB = $to->getCenterHistory()->toArray(); +// var_dump($centerHistoriesB); + $datesArrayB = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesB); + + if (!count($datesArrayB) === 0) { + $oldestDateB = min($datesArrayB); + + $indexOldestCenter = array_search(min($centerHistoriesB), $centerHistoriesB); + $oldestCenterHistoryB = $centerHistoriesB[$indexOldestCenter]; + } + + $sqlDelete = sprintf("delete FROM chill_person_person_center_history WHERE person_id = %d", $from->getId()); + + $sqlStatements = [$sqlDelete]; + + if ($oldestDateA <= $oldestDateB) { + $sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s'::date WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); + + $sqlStatements = [$sqlInsert, $sqlDelete]; + } + + return $sqlStatements; - SQL, $to->getId()); } } diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 05fc98aa6..fa6c5faa9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -3,6 +3,7 @@ namespace Action\Remove; use Chill\ActivityBundle\Entity\Activity; +use Chill\MainBundle\Entity\Center; use Chill\PersonBundle\Actions\Remove\PersonMove; use Chill\PersonBundle\Actions\Remove\PersonMoveManager; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -62,7 +63,6 @@ class PersonMoveTest extends KernelTestCase $conn = $this->em->getConnection(); // $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { -// var_dump($sql); $conn->executeStatement($sql); } // }); @@ -74,6 +74,56 @@ class PersonMoveTest extends KernelTestCase self::assertNotNull($personB?->getId(), $message); } + public function testMovePersonCenterHistory(): void + { + $personA = new Person(); + $personB = new Person(); + $centerA = ($this->em->getRepository(Center::class))->find(1); + $centerB = ($this->em->getRepository(Center::class))->find(2); + + $personCenterHistoryAFirst = (new Person\PersonCenterHistory())->setPerson($personA)->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-06-30')); + $personCenterHistoryASecond = (new Person\PersonCenterHistory())->setPerson($personA)->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-06-30'))->setEndDate(new \DateTimeImmutable('2023-09-30')); + + $personCenterHistoryBFirst = (new Person\PersonCenterHistory())->setPerson($personB)->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-07-15')); + $personCenterHistoryBSecond = (new Person\PersonCenterHistory())->setPerson($personB)->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-07-15'))->setEndDate(new \DateTimeImmutable('2023-09-30')); + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($personCenterHistoryAFirst); + $this->em->persist($personCenterHistoryASecond); + $this->em->persist($personCenterHistoryBFirst); + $this->em->persist($personCenterHistoryBSecond); + + $this->em->flush(); + $this->em->clear(); + + $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); + $sqls = $move->getSQL($personA, $personB); + $conn = $this->em->getConnection(); +// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { + foreach ($sqls as $sql) { + $conn->executeStatement($sql); + } +// }); + + $personA = $this->em->find(Person::class, $personA->getId()); + $personB = $this->em->find(Person::class, $personB->getId()); + $remainingCenterHistory = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $personB]); + + $message = 'Move persons with overlapping center histories'; + + self::assertNull($personA?->getId(), $message); + self::assertNotNull($personB?->getId(), $message); + self::assertEquals(new \DateTimeImmutable('2023-01-01'), $remainingCenterHistory->getStartDate()); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [Person\PersonCenterHistory::class, $personCenterHistoryAFirst]; + self::$entitiesToDelete[] = [Person\PersonCenterHistory::class, $personCenterHistoryASecond]; + self::$entitiesToDelete[] = [Person\PersonCenterHistory::class, $personCenterHistoryBFirst]; + self::$entitiesToDelete[] = [Person\PersonCenterHistory::class, $personCenterHistoryBSecond]; + } + public function dataProviderMovePerson(): iterable { $this->setUp(); From 2921073da3ed8dea09ba7d6a2e5348f707a0a629 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 27 Jul 2023 10:34:19 +0200 Subject: [PATCH 09/91] [centerHistory] add conditions to be sure at least one center history exists per person --- .../Remove/Handler/PersonMoveCenterHistoryHandler.php | 7 ++++--- .../Tests/Action/Remove/PersonMoveTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index 1c1b2f8f0..53ec57843 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -20,10 +20,11 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface public function getSqls(string $className, string $field, Person $from, Person $to): array { $sqlStatements = []; + $oldestDateA = null; + $oldestDateB = null; $centerHistoriesA = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $from->getId()]); // $centerHistoriesA = $from->getCenterHistory()->toArray(); -// var_dump($centerHistoriesA); $datesArrayA = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesA); if (!count($datesArrayA) === 0) { $oldestDateA = min($datesArrayA); @@ -31,7 +32,6 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $centerHistoriesB = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $to->getId()]); // $centerHistoriesB = $to->getCenterHistory()->toArray(); -// var_dump($centerHistoriesB); $datesArrayB = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesB); if (!count($datesArrayB) === 0) { @@ -45,12 +45,13 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $sqlStatements = [$sqlDelete]; - if ($oldestDateA <= $oldestDateB) { + if ((null !== $oldestDateA && null !== $oldestDateB) && $oldestDateA <= $oldestDateB) { $sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s'::date WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); $sqlStatements = [$sqlInsert, $sqlDelete]; } + var_dump($sqlStatements); return $sqlStatements; } diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index fa6c5faa9..613baaf44 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -61,11 +61,11 @@ class PersonMoveTest extends KernelTestCase $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); $conn = $this->em->getConnection(); -// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { + $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { $conn->executeStatement($sql); } -// }); + }); $personA = $this->em->find(Person::class, $personA->getId()); $personB = $this->em->find(Person::class, $personB->getId()); @@ -100,11 +100,11 @@ class PersonMoveTest extends KernelTestCase $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); $conn = $this->em->getConnection(); -// $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { + $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { $conn->executeStatement($sql); } -// }); + }); $personA = $this->em->find(Person::class, $personA->getId()); $personB = $this->em->find(Person::class, $personB->getId()); From 7758d62f866c5862968e618c99ab59ccd153661f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 27 Jul 2023 10:47:42 +0200 Subject: [PATCH 10/91] FIX remove var_dump --- .../Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index 53ec57843..2798fd99e 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -51,7 +51,6 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $sqlStatements = [$sqlInsert, $sqlDelete]; } - var_dump($sqlStatements); return $sqlStatements; } From fd79692f6df24c0aae361f64ecc6e96eb186eaa6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Aug 2023 11:38:13 +0200 Subject: [PATCH 11/91] FEATURE [relationships] Add personMoveRelationHandler and test for this --- .../Handler/PersonMoveRelationHandler.php | 38 +++++++++++++++++++ .../Tests/Action/Remove/PersonMoveTest.php | 30 +++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php new file mode 100644 index 000000000..3454fce24 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -0,0 +1,38 @@ +getId(), $from->getId(), $to->getId(), $from->getId(), $from->getId(), $to->getId()); + + $deleteSql = sprintf(<<getId(), $from->getId()); + + return [$insertSql, $deleteSql]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 613baaf44..d0ebf9a85 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -4,6 +4,7 @@ namespace Action\Remove; use Chill\ActivityBundle\Entity\Activity; use Chill\MainBundle\Entity\Center; +use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Actions\Remove\PersonMove; use Chill\PersonBundle\Actions\Remove\PersonMoveManager; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -11,6 +12,9 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Household\HouseholdMember; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\Relationships\Relation; +use Chill\PersonBundle\Entity\Relationships\Relationship; +use Chill\PersonBundle\Repository\PersonRepository; use Doctrine\DBAL\Connection; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -200,6 +204,32 @@ class PersonMoveTest extends KernelTestCase yield [$personA, $personB, "move 2 people participating to the same parcours"]; + $personA = new Person(); + $personB = new Person(); + $relationship = new Relationship(); + $relation = new Relation(); + $user = new User(); + + $relationship->setRelation($relation); + $relationship->setToPerson($personA); + $relationship->setFromPerson($personB); + $relationship->setReverse(false); + $relationship->setCreatedBy($user); + + $this->em->persist($personA); + $this->em->persist($personB); + $this->em->persist($relation); + $this->em->persist($user); + $this->em->persist($relationship); + + self::$entitiesToDelete[] = [Person::class, $personA]; + self::$entitiesToDelete[] = [Person::class, $personB]; + self::$entitiesToDelete[] = [Relation::class, $relation]; + self::$entitiesToDelete[] = [User::class, $user]; + self::$entitiesToDelete[] = [Relationship::class, $relationship]; + + yield [$personA, $personB, "move 2 people with a relationship"]; + $this->em->flush(); $this->em->clear(); } From 3af065e5307342171d21c68c755520838bdb688c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Aug 2023 11:40:47 +0200 Subject: [PATCH 12/91] WIP [centerHistory] Try to get test to work for personCenterHistory --- .../PersonMoveCenterHistoryHandler.php | 10 +++--- .../ChillPersonBundle/Entity/Person.php | 9 +++++ .../Tests/Action/Remove/PersonMoveTest.php | 33 ++++++++++++++----- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index 2798fd99e..4d4203a0b 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -4,11 +4,11 @@ namespace Chill\PersonBundle\Actions\Remove\Handler; use Chill\PersonBundle\Actions\Remove\PersonMoveSqlHandlerInterface; use Chill\PersonBundle\Entity\Person; -use Doctrine\ORM\EntityManagerInterface; +use Chill\PersonBundle\Repository\Person\PersonCenterHistoryRepository; class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface { - public function __construct(private EntityManagerInterface $em) + public function __construct(private PersonCenterHistoryRepository $centerHistoryRepository) { } @@ -23,15 +23,13 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $oldestDateA = null; $oldestDateB = null; - $centerHistoriesA = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $from->getId()]); -// $centerHistoriesA = $from->getCenterHistory()->toArray(); + $centerHistoriesA = $this->centerHistoryRepository->findBy(['person' => $from]); $datesArrayA = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesA); if (!count($datesArrayA) === 0) { $oldestDateA = min($datesArrayA); } - $centerHistoriesB = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $to->getId()]); -// $centerHistoriesB = $to->getCenterHistory()->toArray(); + $centerHistoriesB = $this->centerHistoryRepository->findBy(['person' => $to]); $datesArrayB = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesB); if (!count($datesArrayB) === 0) { diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index af8e7f92b..81e603fbc 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -1606,6 +1606,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } + public function addCenterHistory(PersonCenterHistory $newCenterHistory): self + { + if (!$this->centerHistory->contains($newCenterHistory)) { + $this->centerHistory[] = $newCenterHistory; + $newCenterHistory->setPerson($this); + } + return $this; + } + /** * @return Person */ diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index d0ebf9a85..64b39a20b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -85,20 +85,38 @@ class PersonMoveTest extends KernelTestCase $centerA = ($this->em->getRepository(Center::class))->find(1); $centerB = ($this->em->getRepository(Center::class))->find(2); - $personCenterHistoryAFirst = (new Person\PersonCenterHistory())->setPerson($personA)->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-06-30')); - $personCenterHistoryASecond = (new Person\PersonCenterHistory())->setPerson($personA)->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-06-30'))->setEndDate(new \DateTimeImmutable('2023-09-30')); - - $personCenterHistoryBFirst = (new Person\PersonCenterHistory())->setPerson($personB)->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-07-15')); - $personCenterHistoryBSecond = (new Person\PersonCenterHistory())->setPerson($personB)->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-07-15'))->setEndDate(new \DateTimeImmutable('2023-09-30')); - $this->em->persist($personA); $this->em->persist($personB); + + $personCenterHistoryAFirst = (new Person\PersonCenterHistory())->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-06-30')); + $personCenterHistoryASecond = (new Person\PersonCenterHistory())->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-06-30'))->setEndDate(new \DateTimeImmutable('2023-09-30')); + $personCenterHistoryBFirst = (new Person\PersonCenterHistory())->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-07-15')); + $personCenterHistoryBSecond = (new Person\PersonCenterHistory())->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-07-15'))->setEndDate(new \DateTimeImmutable('2023-09-30')); + +// $personA->getCenterHistory()->add($personCenterHistoryAFirst); +// $personA->getCenterHistory()->add($personCenterHistoryASecond); +// $personB->getCenterHistory()->add($personCenterHistoryBFirst); +// $personB->getCenterHistory()->add($personCenterHistoryBSecond); + +// $personCenterHistoryAFirst->setPerson($personA); +// $personCenterHistoryASecond->setPerson($personA); +// $personCenterHistoryBFirst->setPerson($personB); +// $personCenterHistoryBSecond->setPerson($personB); + $this->em->persist($personCenterHistoryAFirst); $this->em->persist($personCenterHistoryASecond); $this->em->persist($personCenterHistoryBFirst); $this->em->persist($personCenterHistoryBSecond); + $personA->addCenterHistory($personCenterHistoryAFirst); + $personA->addCenterHistory($personCenterHistoryASecond); + $personB->addCenterHistory($personCenterHistoryBFirst); + $personB->addCenterHistory($personCenterHistoryBSecond); + $this->em->flush(); +// $this->em->refresh($personA); +// $this->em->refresh($personB); + $this->em->clear(); $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); @@ -112,13 +130,10 @@ class PersonMoveTest extends KernelTestCase $personA = $this->em->find(Person::class, $personA->getId()); $personB = $this->em->find(Person::class, $personB->getId()); - $remainingCenterHistory = $this->em->getRepository(Person\PersonCenterHistory::class)->findBy(['person' => $personB]); - $message = 'Move persons with overlapping center histories'; self::assertNull($personA?->getId(), $message); self::assertNotNull($personB?->getId(), $message); - self::assertEquals(new \DateTimeImmutable('2023-01-01'), $remainingCenterHistory->getStartDate()); self::$entitiesToDelete[] = [Person::class, $personA]; self::$entitiesToDelete[] = [Person::class, $personB]; From 256579af892ac55b65a6ee12b943a1e9b7a1a539 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Aug 2023 11:41:36 +0200 Subject: [PATCH 13/91] FIX Assign the correct id_seq for PersonMoveAccompanyingPeriodParticipationHandler --- .../PersonMoveAccompanyingPeriodParticipationHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index e164dcaf8..cb18bd4cd 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -17,7 +17,7 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH { $insertSql = sprintf(<< Date: Mon, 21 Aug 2023 11:24:33 +0200 Subject: [PATCH 14/91] FIX [filter][missionType] reimplement mission type task filter --- .../Controller/SingleTaskController.php | 19 +++++++++++++++++-- .../SingleTaskAclAwareRepository.php | 13 +++++++++++-- .../SingleTaskAclAwareRepositoryInterface.php | 2 ++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 4c6ab338f..ba67b62c4 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -300,7 +300,9 @@ final class SingleTaskController extends AbstractController ) { $this->denyAccessUnlessGranted(TaskVoter::SHOW, null); - $filterOrder = $this->buildFilterOrder(); + $showMissionTypeFilter = $this->getParameter('show_mission_type_filter'); + + $filterOrder = $this->buildFilterOrder(true, $showMissionTypeFilter); $filteredUsers = $filterOrder->getUserPickerData('userPicker'); @@ -308,9 +310,15 @@ final class SingleTaskController extends AbstractController $filterOrder->getCheckboxData('status'), array_map(static fn ($i) => 'state_' . $i, $filterOrder->hasCheckboxData('states') ? $filterOrder->getCheckboxData('states') : []) ); + + if ($showMissionTypeFilter) { + $types = $filterOrder->getCheckboxData('missionTypePicker'); + } + $nb = $this->singleTaskAclAwareRepository->countByAllViewable( $filterOrder->getQueryString(), $flags, + $types ?? [], $filteredUsers ); $paginator = $this->paginatorFactory->create($nb); @@ -319,6 +327,7 @@ final class SingleTaskController extends AbstractController $tasks = $this->singleTaskAclAwareRepository->findByAllViewable( $filterOrder->getQueryString(), $flags, + $types ?? [], $filteredUsers, $paginator->getCurrentPageFirstItemNumber(), $paginator->getItemsPerPage(), @@ -669,7 +678,7 @@ final class SingleTaskController extends AbstractController return $form; } - private function buildFilterOrder($includeFilterByUser = true): FilterOrderHelper + private function buildFilterOrder($includeFilterByUser = true, $includeMissionType = false): FilterOrderHelper { $statuses = ['no-alert', 'warning', 'alert']; $statusTrans = [ @@ -678,6 +687,8 @@ final class SingleTaskController extends AbstractController 'Tasks over deadline', ]; + $missionTypes = ['fsl', 'ispah', 'diagnostic_maintien', 'social_help', 'ni', 'diagnostic_acces']; + $filterBuilder = $this->filterOrderHelperFactory ->create(self::class) ->addSearchBox() @@ -696,6 +707,10 @@ final class SingleTaskController extends AbstractController ->addUserPicker('userPicker', 'Filter by user', ['multiple' => true, 'required' => false]); } + if ($includeMissionType) { + $filterBuilder->addCheckbox('missionTypePicker', $missionTypes); + } + return $filterBuilder->build(); } diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index 53ed4c38d..c8f989765 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -52,6 +52,7 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository public function buildBaseQuery( ?string $pattern = null, ?array $flags = [], + ?array $types = [], ?array $users = [] ): QueryBuilder { $qb = $this->em->createQueryBuilder(); @@ -81,6 +82,12 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository return $qb; } + if (null !== $types && count($types) > 0) { + $qb->andWhere($qb->expr()->in('t.type', ':types')); + + $qb->setParameter('types', $types); + } + if (null !== $flags && count($flags) > 0) { $orXDate = $qb->expr()->orX(); $orXState = $qb->expr()->orX(); @@ -203,9 +210,10 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository public function countByAllViewable( ?string $pattern = null, ?array $flags = [], + ?array $types = [], ?array $users = [] ): int { - $qb = $this->buildBaseQuery($pattern, $flags, $users); + $qb = $this->buildBaseQuery($pattern, $flags, $types, $users); return $this ->addACLGlobal($qb) @@ -251,12 +259,13 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository public function findByAllViewable( ?string $pattern = null, ?array $flags = [], + ?array $types = [], ?array $users = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = [] ): array { - $qb = $this->buildBaseQuery($pattern, $flags, $users); + $qb = $this->buildBaseQuery($pattern, $flags, $types, $users); $qb = $this->addACLGlobal($qb); return $this->getResult($qb, $start, $limit, $orderBy); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php index 7d2870c67..bb63c0caa 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php @@ -19,6 +19,7 @@ interface SingleTaskAclAwareRepositoryInterface public function countByAllViewable( ?string $pattern = null, ?array $flags = [], + ?array $types = [], ?array $users = [] ): int; @@ -39,6 +40,7 @@ interface SingleTaskAclAwareRepositoryInterface public function findByAllViewable( ?string $pattern = null, ?array $flags = [], + ?array $types = [], ?array $users = [], ?int $start = 0, ?int $limit = 50, From 6275623f5eb1ff8d9ba3960ce3c12b8e0d182fe7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 21 Aug 2023 11:40:30 +0200 Subject: [PATCH 15/91] FIX [task][filter] use config parameter for list of mission types --- src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index ba67b62c4..f52d678df 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -687,8 +687,6 @@ final class SingleTaskController extends AbstractController 'Tasks over deadline', ]; - $missionTypes = ['fsl', 'ispah', 'diagnostic_maintien', 'social_help', 'ni', 'diagnostic_acces']; - $filterBuilder = $this->filterOrderHelperFactory ->create(self::class) ->addSearchBox() @@ -708,6 +706,7 @@ final class SingleTaskController extends AbstractController } if ($includeMissionType) { + $missionTypes = $this->getParameter('task_types'); $filterBuilder->addCheckbox('missionTypePicker', $missionTypes); } From bf27e81e350cd415d63806e537cb129ffffb3a89 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 21 Aug 2023 16:10:32 +0200 Subject: [PATCH 16/91] DX add changie --- .changes/unreleased/Fixed-20230821-115738.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixed-20230821-115738.yaml diff --git a/.changes/unreleased/Fixed-20230821-115738.yaml b/.changes/unreleased/Fixed-20230821-115738.yaml new file mode 100644 index 000000000..366d46ed2 --- /dev/null +++ b/.changes/unreleased/Fixed-20230821-115738.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Reimplement the mission type filter on tasks, only for instances that have a + config parameter indicating true for this. +time: 2023-08-21T11:57:38.273630026+02:00 +custom: + Issue: "" From fa47dcd5b616badbdf0f00dc33ae2d7fab3b465b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 15:50:12 +0200 Subject: [PATCH 17/91] FIX [center][crud] use crud controller for center entity --- .../Controller/CenterController.php | 168 +----------------- .../ChillMainExtension.php | 24 +++ .../ChillMainBundle/Form/CenterType.php | 27 ++- .../views/Admin/Center/edit.html.twig | 11 ++ .../views/Admin/Center/index.html.twig | 39 ++++ .../views/Admin/Center/new.html.twig | 11 ++ .../Resources/views/Center/edit.html.twig | 23 --- .../Resources/views/Center/index.html.twig | 50 ------ .../Resources/views/Center/new.html.twig | 23 --- .../MenuBuilder/AdminUserMenuBuilder.php | 2 +- src/Bundle/ChillMainBundle/config/routes.yaml | 6 +- .../translations/messages.fr.yml | 6 + 12 files changed, 113 insertions(+), 277 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Center/edit.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Admin/Center/new.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig delete mode 100644 src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig diff --git a/src/Bundle/ChillMainBundle/Controller/CenterController.php b/src/Bundle/ChillMainBundle/Controller/CenterController.php index 1cc129e5d..fef36c11b 100644 --- a/src/Bundle/ChillMainBundle/Controller/CenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/CenterController.php @@ -11,178 +11,22 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; +use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Form\CenterType; -use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Chill\MainBundle\Pagination\PaginatorInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\Request; /** * Class CenterController. */ -class CenterController extends AbstractController +class CenterController extends CRUDController { - /** - * Creates a new Center entity. - */ - public function createAction(Request $request) + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { - $center = new Center(); - $form = $this->createCreateForm($center); - $form->handleRequest($request); + $query->addOrderBy('e.name', 'ASC'); - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $em->persist($center); - $em->flush(); - - return $this->redirect($this->generateUrl('admin_center')); - } - - return $this->render('@ChillMain/Center/new.html.twig', [ - 'entity' => $center, - 'form' => $form->createView(), - ]); - } - - /** - * Displays a form to edit an existing Center entity. - * - * @param mixed $id - */ - public function editAction($id) - { - $em = $this->getDoctrine()->getManager(); - - $center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id); - - if (!$center) { - throw $this->createNotFoundException('Unable to find Center entity.'); - } - - $editForm = $this->createEditForm($center); - - return $this->render('@ChillMain/Center/edit.html.twig', [ - 'entity' => $center, - 'edit_form' => $editForm->createView(), - ]); - } - - /** - * Lists all Center entities. - */ - public function indexAction() - { - $em = $this->getDoctrine()->getManager(); - - $entities = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->findAll(); - - usort($entities, fn (Center $a, Center $b) => $a->getName() <=> $b->getName()); - - return $this->render('@ChillMain/Center/index.html.twig', [ - 'entities' => $entities, - ]); - } - - /** - * Displays a form to create a new Center entity. - */ - public function newAction() - { - $center = new Center(); - $form = $this->createCreateForm($center); - - return $this->render('@ChillMain/Center/new.html.twig', [ - 'entity' => $center, - 'form' => $form->createView(), - ]); - } - - /** - * Finds and displays a Center entity. - * - * @param mixed $id - */ - public function showAction($id) - { - $em = $this->getDoctrine()->getManager(); - - $center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id); - - if (!$center) { - throw $this->createNotFoundException('Unable to find Center entity.'); - } - - return $this->render('@ChillMain/Center/show.html.twig', [ - 'entity' => $center, - ]); - } - - /** - * Edits an existing Center entity. - * - * @param mixed $id - */ - public function updateAction(Request $request, $id) - { - $em = $this->getDoctrine()->getManager(); - - $center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id); - - if (!$center) { - throw $this->createNotFoundException('Unable to find Center entity.'); - } - - $editForm = $this->createEditForm($center); - $editForm->handleRequest($request); - - if ($editForm->isValid()) { - $em->flush(); - - return $this->redirect($this->generateUrl('admin_center_edit', ['id' => $id])); - } - - return $this->render('@ChillMain/Center/edit.html.twig', [ - 'entity' => $center, - 'edit_form' => $editForm->createView(), - ]); - } - - /** - * Creates a form to create a Center entity. - * - * @param Center $center The entity - * - * @return \Symfony\Component\Form\Form The form - */ - private function createCreateForm(Center $center) - { - $form = $this->createForm(CenterType::class, $center, [ - 'action' => $this->generateUrl('admin_center_create'), - 'method' => 'POST', - ]); - - $form->add('submit', SubmitType::class, ['label' => 'Create']); - - return $form; - } - - /** - * Creates a form to edit a Center entity. - * - * @param Center $center The entity - * - * @return \Symfony\Component\Form\Form The form - */ - private function createEditForm(Center $center) - { - $form = $this->createForm(CenterType::class, $center, [ - 'action' => $this->generateUrl('admin_center_update', ['id' => $center->getId()]), - 'method' => 'PUT', - ]); - - $form->add('submit', SubmitType::class, ['label' => 'Update']); - - return $form; + return parent::orderQuery($action, $query, $request, $paginator); } } diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index c86a69be2..a8ac588f1 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\DependencyInjection; use Chill\MainBundle\Controller\AddressApiController; +use Chill\MainBundle\Controller\CenterController; use Chill\MainBundle\Controller\CivilityApiController; use Chill\MainBundle\Controller\CivilityController; use Chill\MainBundle\Controller\CountryController; @@ -44,6 +45,7 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent; use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType; use Chill\MainBundle\Doctrine\Type\PointType; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Entity\GeographicalUnitLayer; @@ -53,6 +55,7 @@ use Chill\MainBundle\Entity\LocationType; use Chill\MainBundle\Entity\Regroupment; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; +use Chill\MainBundle\Form\CenterType; use Chill\MainBundle\Form\CivilityType; use Chill\MainBundle\Form\CountryType; use Chill\MainBundle\Form\LanguageType; @@ -524,6 +527,27 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => Center::class, + 'name' => 'center', + 'base_path' => '/admin/center', + 'form_class' => CenterType::class, + 'controller' => CenterController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Center/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Center/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Admin/Center/edit.html.twig', + ], + ], + ], ], 'apis' => [ [ diff --git a/src/Bundle/ChillMainBundle/Form/CenterType.php b/src/Bundle/ChillMainBundle/Form/CenterType.php index ff758ca49..ed5a496d6 100644 --- a/src/Bundle/ChillMainBundle/Form/CenterType.php +++ b/src/Bundle/ChillMainBundle/Form/CenterType.php @@ -11,7 +11,10 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; +use Chill\MainBundle\Entity\Center; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -21,24 +24,18 @@ class CenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', TextType::class); + ->add('name', TextType::class, [ + 'label' => 'Nom', + ]); +/* ->add('isActive', CheckboxType::class, [ + 'label' => 'Actif ?', + 'required' => false, + ]);*/ } - /** - * @param OptionsResolverInterface $resolver - */ public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults([ - 'data_class' => \Chill\MainBundle\Entity\Center::class, - ]); - } - - /** - * @return string - */ - public function getBlockPrefix() - { - return 'chill_mainbundle_center'; + $resolver + ->setDefault('class', Center::class); } } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/edit.html.twig new file mode 100644 index 000000000..4d55c480c --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig new file mode 100644 index 000000000..e5554f6d9 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig @@ -0,0 +1,39 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Label'|trans }} +{# {{ 'Active'|trans }}#} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.name }} +{# #} +{# {% if entity.isActive %}#} +{# #} +{# {% else %}#} +{# #} +{# {% endif %}#} +{# #} + +
      +
    • + +
    • +
    + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
  • + {{'Back to the admin'|trans}} +
  • + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/new.html.twig new file mode 100644 index 000000000..7c204dddd --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/new.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig deleted file mode 100644 index 1894a1402..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/edit.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} - -{% block title %}{{ 'Center edit'|trans }}{% endblock %} - -{% block admin_content -%} -

    {{ 'Center edit'|trans }}

    - - {{ form_start(edit_form) }} - {{ form_row(edit_form.name) }} - - - - {{ form_end(edit_form) }} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig deleted file mode 100644 index cb2da8a62..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/index.html.twig +++ /dev/null @@ -1,50 +0,0 @@ -{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} - -{% block title %}{{ 'Center list'|trans }}{% endblock %} - -{% block admin_content -%} - {% embed '@ChillMain/CRUD/_index.html.twig' %} - - {% block index_header %} -

    {{ 'Center list'|trans }}

    - {% endblock %} - - {% block filter_order %}{% endblock %} - - {% block table_entities_thead_tr %} - id - {{ 'Name'|trans }} - {{ 'Actions'|trans }} - {% endblock %} - - {% block table_entities_tbody %} - {% for entity in entities %} - - {{ entity.id }} - {{ entity.name }} - - - - - {% endfor %} - {% endblock %} - - {% block pagination %}{% endblock %} - - {% block list_actions %} - - {% endblock list_actions %} - - {% endembed %} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig deleted file mode 100644 index cc64b37c2..000000000 --- a/src/Bundle/ChillMainBundle/Resources/views/Center/new.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %} - -{% block title %}{{ 'Center creation'|trans }}{% endblock %} - -{% block admin_content -%} -

    {{ 'Center creation'|trans }}

    - - {{ form_start(form) }} - {{ form_row(form.name) }} - - - - {{ form_end(form) }} -{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php index 7bd23c81f..8e2ccb7c6 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php @@ -49,7 +49,7 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface ]); $menu->addChild('Center list', [ - 'route' => 'admin_center', + 'route' => 'chill_crud_center_index', ])->setExtras(['order' => 1010]); $menu->addChild('Regroupements des centres', [ diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index d25f2aaff..7e2af7a7f 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -10,9 +10,9 @@ chill_main_admin_scope: resource: "@ChillMainBundle/config/routes/scope.yaml" prefix: "{_locale}/admin/scope" -chill_main_admin: - resource: "@ChillMainBundle/config/routes/center.yaml" - prefix: "{_locale}/admin/center" +#chill_main_admin: +# resource: "@ChillMainBundle/config/routes/center.yaml" +# prefix: "{_locale}/admin/center" chill_main_exports: resource: "@ChillMainBundle/config/routes/exports.yaml" diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 6a6136a41..6cbb1fef4 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -425,6 +425,12 @@ crud: add_new: Ajouter un regroupement title_new: Nouveau regroupement title_edit: Modifier un regroupement + center: + index: + title: Liste des centres + add_new: Ajouter un centre + title_new: Nouveau centre + title_edit: Modifier un centre No entities: Aucun élément From ba41ab98f7f4982e5c49c322ef5c3112e089114e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 15:50:45 +0200 Subject: [PATCH 18/91] FEATURE [isActive][center] add isActive property to the center entity --- src/Bundle/ChillMainBundle/Entity/Center.php | 5 ++++ .../migrations/Version20230906134410.php | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/migrations/Version20230906134410.php diff --git a/src/Bundle/ChillMainBundle/Entity/Center.php b/src/Bundle/ChillMainBundle/Entity/Center.php index 0d5402409..23bd2812d 100644 --- a/src/Bundle/ChillMainBundle/Entity/Center.php +++ b/src/Bundle/ChillMainBundle/Entity/Center.php @@ -48,6 +48,11 @@ class Center implements HasCenterInterface */ private string $name = ''; + /** + * @ORM\Column(type="boolean") + */ + private bool $isActive = true; + /** * @var Collection * @ORM\ManyToMany(targetEntity=Regroupment::class, mappedBy="centers") diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php new file mode 100644 index 000000000..231dffb23 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE centers ADD isActive BOOLEAN NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE centers DROP isActive'); + } +} From 63015055632ead94ea53c24ceef0ae1b9dc2d9c3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 15:52:26 +0200 Subject: [PATCH 19/91] DX add changie --- .changes/unreleased/Feature-20230906-155212.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Feature-20230906-155212.yaml diff --git a/.changes/unreleased/Feature-20230906-155212.yaml b/.changes/unreleased/Feature-20230906-155212.yaml new file mode 100644 index 000000000..c894bbf72 --- /dev/null +++ b/.changes/unreleased/Feature-20230906-155212.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Use the CRUD controller for center entity + add the isActive property to be + able to mask instances of Center that are no longer in use. +time: 2023-09-06T15:52:12.561065323+02:00 +custom: + Issue: "" From 7c7c5862c6fe58816de05ae8417d84512e5ff854 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 15:56:04 +0200 Subject: [PATCH 20/91] FEATURE [center][isActive] add getter and setter + integrate into template --- src/Bundle/ChillMainBundle/Entity/Center.php | 12 ++++++++++++ .../Resources/views/Admin/Center/index.html.twig | 16 ++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/Center.php b/src/Bundle/ChillMainBundle/Entity/Center.php index 23bd2812d..5e72f43a2 100644 --- a/src/Bundle/ChillMainBundle/Entity/Center.php +++ b/src/Bundle/ChillMainBundle/Entity/Center.php @@ -126,6 +126,11 @@ class Center implements HasCenterInterface return $this->regroupments; } + public function getIsActive(): bool + { + return $this->isActive; + } + /** * @param $name * @@ -137,4 +142,11 @@ class Center implements HasCenterInterface return $this; } + + public function setIsActive(bool $isActive): self + { + $this->isActive = $isActive; + + return $this; + } } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig index e5554f6d9..27c19c504 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/Center/index.html.twig @@ -4,7 +4,7 @@ {% embed '@ChillMain/CRUD/_index.html.twig' %} {% block table_entities_thead_tr %} {{ 'Label'|trans }} -{# {{ 'Active'|trans }}#} + {{ 'Active'|trans }}   {% endblock %} @@ -12,13 +12,13 @@ {% for entity in entities %} {{ entity.name }} -{# #} -{# {% if entity.isActive %}#} -{# #} -{# {% else %}#} -{# #} -{# {% endif %}#} -{# #} + + {% if entity.isActive %} + + {% else %} + + {% endif %} +
    • From 82b30258422caadf6e6ca8813dccd83244491923 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 15:56:48 +0200 Subject: [PATCH 21/91] DX php cs fixer --- src/Bundle/ChillMainBundle/Form/CenterType.php | 8 ++++---- .../ChillMainBundle/migrations/Version20230906134410.php | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/CenterType.php b/src/Bundle/ChillMainBundle/Form/CenterType.php index ed5a496d6..1a106192a 100644 --- a/src/Bundle/ChillMainBundle/Form/CenterType.php +++ b/src/Bundle/ChillMainBundle/Form/CenterType.php @@ -27,10 +27,10 @@ class CenterType extends AbstractType ->add('name', TextType::class, [ 'label' => 'Nom', ]); -/* ->add('isActive', CheckboxType::class, [ - 'label' => 'Actif ?', - 'required' => false, - ]);*/ + /* ->add('isActive', CheckboxType::class, [ + 'label' => 'Actif ?', + 'required' => false, + ]);*/ } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php index 231dffb23..b03af5a5f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * Chill is a software for social workers + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace Chill\Migrations\Main; use Doctrine\DBAL\Schema\Schema; From b256c3176ee6317616bb73f1c25a104c198d7555 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 16:05:21 +0200 Subject: [PATCH 22/91] FIX [migration][center] set default value in center migration to add isActive --- src/Bundle/ChillMainBundle/migrations/Version20230906134410.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php index b03af5a5f..ac18c9c29 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php @@ -26,7 +26,7 @@ final class Version20230906134410 extends AbstractMigration public function up(Schema $schema): void { - $this->addSql('ALTER TABLE centers ADD isActive BOOLEAN NOT NULL'); + $this->addSql('ALTER TABLE centers ADD isActive BOOLEAN DEFAULT true NOT NULL'); } public function down(Schema $schema): void From 03baee4286f2eca9a56eb6c9ccae517195872181 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 16:05:59 +0200 Subject: [PATCH 23/91] FIX [repository][center] adjust center repository to find all active entities --- src/Bundle/ChillMainBundle/Repository/CenterRepository.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php index eaa0a6b1e..f8646811e 100644 --- a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php @@ -29,9 +29,12 @@ final class CenterRepository implements CenterRepositoryInterface return $this->repository->find($id, $lockMode, $lockVersion); } + /** + * @return Center[] + */ public function findActive(): array { - return $this->findAll(); + return $this->repository->findBy(['isActive' => true], ['name' => 'ASC']); } /** From f3a37d435f0abdd53065216b03be652ba4fad042 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 16:21:29 +0200 Subject: [PATCH 24/91] FEATURE [form][isActive] add form field for isActive property --- src/Bundle/ChillMainBundle/Form/CenterType.php | 10 +++++----- src/Bundle/ChillMainBundle/Form/UserType.php | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/CenterType.php b/src/Bundle/ChillMainBundle/Form/CenterType.php index 1a106192a..b3a212a66 100644 --- a/src/Bundle/ChillMainBundle/Form/CenterType.php +++ b/src/Bundle/ChillMainBundle/Form/CenterType.php @@ -26,11 +26,11 @@ class CenterType extends AbstractType $builder ->add('name', TextType::class, [ 'label' => 'Nom', - ]); - /* ->add('isActive', CheckboxType::class, [ - 'label' => 'Actif ?', - 'required' => false, - ]);*/ + ]) + ->add('isActive', CheckboxType::class, [ + 'label' => 'Actif ?', + 'required' => false, + ]); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index f8485aa99..4119a3ed0 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -67,6 +67,7 @@ class UserType extends AbstractType 'class' => Center::class, 'query_builder' => static function (EntityRepository $er) { $qb = $er->createQueryBuilder('c'); + $qb->where($qb->expr()->eq('c.isActive', 'true')); $qb->addOrderBy('c.name'); return $qb; From f30b4ff4523e5ac705fcba72485d5cd767e780c9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Sep 2023 16:22:03 +0200 Subject: [PATCH 25/91] DX php cs fixer --- src/Bundle/ChillMainBundle/Form/CenterType.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/CenterType.php b/src/Bundle/ChillMainBundle/Form/CenterType.php index b3a212a66..864d0a877 100644 --- a/src/Bundle/ChillMainBundle/Form/CenterType.php +++ b/src/Bundle/ChillMainBundle/Form/CenterType.php @@ -27,10 +27,10 @@ class CenterType extends AbstractType ->add('name', TextType::class, [ 'label' => 'Nom', ]) - ->add('isActive', CheckboxType::class, [ - 'label' => 'Actif ?', - 'required' => false, - ]); + ->add('isActive', CheckboxType::class, [ + 'label' => 'Actif ?', + 'required' => false, + ]); } public function configureOptions(OptionsResolver $resolver) From 94f26df81e370b3e348162fff2af219207961243 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 7 Sep 2023 16:07:23 +0200 Subject: [PATCH 26/91] Make test personMove work for centers --- .../PersonMoveCenterHistoryHandler.php | 31 +++++---- .../Actions/Remove/PersonMove.php | 1 - .../ChillPersonBundle/Entity/Person.php | 1 + .../Tests/Action/Remove/PersonMoveTest.php | 65 +++++++++++-------- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index 4d4203a0b..220adcfc1 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -5,10 +5,14 @@ namespace Chill\PersonBundle\Actions\Remove\Handler; use Chill\PersonBundle\Actions\Remove\PersonMoveSqlHandlerInterface; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Repository\Person\PersonCenterHistoryRepository; +use Doctrine\ORM\EntityManagerInterface; class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface { - public function __construct(private PersonCenterHistoryRepository $centerHistoryRepository) + public function __construct( + private PersonCenterHistoryRepository $centerHistoryRepository, + private EntityManagerInterface $em + ) { } @@ -23,20 +27,23 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $oldestDateA = null; $oldestDateB = null; + $oldestCenterHistoryB = null; + $oldestCenterHistoryA = null; + $centerHistoriesA = $this->centerHistoryRepository->findBy(['person' => $from]); - $datesArrayA = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesA); - if (!count($datesArrayA) === 0) { - $oldestDateA = min($datesArrayA); + foreach ($centerHistoriesA as $ch) { + if ($oldestDateA === null || ($ch->getStartDate() < $oldestDateA)) { + $oldestDateA = $ch->getStartDate(); + $oldestCenterHistoryA = $ch; + } } $centerHistoriesB = $this->centerHistoryRepository->findBy(['person' => $to]); - $datesArrayB = array_map(fn($centerHistory) => $centerHistory->getStartDate(), $centerHistoriesB); - - if (!count($datesArrayB) === 0) { - $oldestDateB = min($datesArrayB); - - $indexOldestCenter = array_search(min($centerHistoriesB), $centerHistoriesB); - $oldestCenterHistoryB = $centerHistoriesB[$indexOldestCenter]; + foreach ($centerHistoriesB as $ch) { + if ($oldestDateB === null || ($ch->getStartDate() < $oldestDateB)) { + $oldestDateB = $ch->getStartDate(); + $oldestCenterHistoryB = $ch; + } } $sqlDelete = sprintf("delete FROM chill_person_person_center_history WHERE person_id = %d", $from->getId()); @@ -44,7 +51,7 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface $sqlStatements = [$sqlDelete]; if ((null !== $oldestDateA && null !== $oldestDateB) && $oldestDateA <= $oldestDateB) { - $sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s'::date WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); + $sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s' WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); $sqlStatements = [$sqlInsert, $sqlDelete]; } diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index ecf17d3b4..c3ecd8ec1 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -209,7 +209,6 @@ class PersonMove private function getDeleteEntities(): array { return [ - Person\PersonCenterHistory::class, AccompanyingPeriod\AccompanyingPeriodWork::class, Relationship::class ]; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 81e603fbc..38e51a60a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -203,6 +203,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * @ORM\OneToMany(targetEntity=PersonCenterHistory::class, mappedBy="person", cascade={"persist"}) + * @ORM\OrderBy({"startDate": "ASC", "id": "ASC"}) * * @var Collection|PersonCenterHistory[] */ diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 64b39a20b..14268160e 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -5,6 +5,7 @@ namespace Action\Remove; use Chill\ActivityBundle\Entity\Activity; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\User; +use Chill\MainBundle\Repository\CenterRepositoryInterface; use Chill\PersonBundle\Actions\Remove\PersonMove; use Chill\PersonBundle\Actions\Remove\PersonMoveManager; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -28,6 +29,8 @@ class PersonMoveTest extends KernelTestCase private EventDispatcherInterface $eventDispatcher; + private CenterRepositoryInterface $centerRepository; + /** * @var list */ @@ -39,6 +42,7 @@ class PersonMoveTest extends KernelTestCase $this->em = self::$container->get(EntityManagerInterface::class); $this->personMoveManager = self::$container->get(PersonMoveManager::class); $this->eventDispatcher = self::$container->get(EventDispatcherInterface::class); + $this->centerRepository = self::$container->get(CenterRepositoryInterface::class); } public static function tearDownAfterClass(): void @@ -60,21 +64,22 @@ class PersonMoveTest extends KernelTestCase /** * @dataProvider dataProviderMovePerson */ - public function testMovePerson(Person $personA, Person $personB, string $message): void + public function testMovePersonSimple(Person $personA, Person $personB, string $message): void { $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); - $conn = $this->em->getConnection(); $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { $conn->executeStatement($sql); } }); - $personA = $this->em->find(Person::class, $personA->getId()); + $personsByIdOfA = $this->em->createQuery("SELECT p FROM " . Person::class . " p WHERE p.id = :id") + ->setParameter('id', $personA->getId()) + ->getResult(); $personB = $this->em->find(Person::class, $personB->getId()); - self::assertNull($personA?->getId(), $message); + self::assertCount(0, $personsByIdOfA); self::assertNotNull($personB?->getId(), $message); } @@ -82,26 +87,23 @@ class PersonMoveTest extends KernelTestCase { $personA = new Person(); $personB = new Person(); - $centerA = ($this->em->getRepository(Center::class))->find(1); - $centerB = ($this->em->getRepository(Center::class))->find(2); + [$centerA, $centerB] = $this->centerRepository->findAll(); $this->em->persist($personA); $this->em->persist($personB); - $personCenterHistoryAFirst = (new Person\PersonCenterHistory())->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-06-30')); - $personCenterHistoryASecond = (new Person\PersonCenterHistory())->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-06-30'))->setEndDate(new \DateTimeImmutable('2023-09-30')); - $personCenterHistoryBFirst = (new Person\PersonCenterHistory())->setCenter($centerA)->setStartDate(new \DateTimeImmutable('2023-01-01'))->setEndDate(new \DateTimeImmutable('2023-07-15')); - $personCenterHistoryBSecond = (new Person\PersonCenterHistory())->setCenter($centerB)->setStartDate(new \DateTimeImmutable('2023-07-15'))->setEndDate(new \DateTimeImmutable('2023-09-30')); - -// $personA->getCenterHistory()->add($personCenterHistoryAFirst); -// $personA->getCenterHistory()->add($personCenterHistoryASecond); -// $personB->getCenterHistory()->add($personCenterHistoryBFirst); -// $personB->getCenterHistory()->add($personCenterHistoryBSecond); - -// $personCenterHistoryAFirst->setPerson($personA); -// $personCenterHistoryASecond->setPerson($personA); -// $personCenterHistoryBFirst->setPerson($personB); -// $personCenterHistoryBSecond->setPerson($personB); + $personCenterHistoryAFirst = (new Person\PersonCenterHistory())->setCenter($centerA) + ->setStartDate(new \DateTimeImmutable('2023-01-01')) + ->setEndDate(new \DateTimeImmutable('2023-06-30')); + $personCenterHistoryASecond = (new Person\PersonCenterHistory())->setCenter($centerB) + ->setStartDate(new \DateTimeImmutable('2023-06-30')) + ->setEndDate(new \DateTimeImmutable('2023-09-30')); + $personCenterHistoryBFirst = (new Person\PersonCenterHistory())->setCenter($centerA) + ->setStartDate(new \DateTimeImmutable('2023-03-01')) + ->setEndDate(new \DateTimeImmutable('2023-07-15')); + $personCenterHistoryBSecond = (new Person\PersonCenterHistory())->setCenter($centerB) + ->setStartDate(new \DateTimeImmutable('2023-07-15')) + ->setEndDate(new \DateTimeImmutable('2023-09-30')); $this->em->persist($personCenterHistoryAFirst); $this->em->persist($personCenterHistoryASecond); @@ -114,27 +116,36 @@ class PersonMoveTest extends KernelTestCase $personB->addCenterHistory($personCenterHistoryBSecond); $this->em->flush(); -// $this->em->refresh($personA); -// $this->em->refresh($personB); - $this->em->clear(); $move = new PersonMove($this->em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); - $conn = $this->em->getConnection(); $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { foreach ($sqls as $sql) { $conn->executeStatement($sql); } }); - $personA = $this->em->find(Person::class, $personA->getId()); + $personsByIdOfA = $this->em->createQuery("SELECT p FROM " . Person::class . " p WHERE p.id = :id") + ->setParameter('id', $personA->getId()) + ->getResult(); + /** @var Person $personB */ $personB = $this->em->find(Person::class, $personB->getId()); $message = 'Move persons with overlapping center histories'; - self::assertNull($personA?->getId(), $message); + $this->em->refresh($personB); + + self::assertCount(0, $personsByIdOfA); self::assertNotNull($personB?->getId(), $message); + $centerHistoriesB = $personB->getCenterHistory(); + $oldestDate = new \DateTimeImmutable('2023-01-01'); + + $this->em->refresh($centerHistoriesB->first()); + + self::assertCount(2, $centerHistoriesB); + self::assertEquals($oldestDate, $centerHistoriesB->first()->getStartDate()); + self::$entitiesToDelete[] = [Person::class, $personA]; self::$entitiesToDelete[] = [Person::class, $personB]; self::$entitiesToDelete[] = [Person\PersonCenterHistory::class, $personCenterHistoryAFirst]; @@ -223,7 +234,7 @@ class PersonMoveTest extends KernelTestCase $personB = new Person(); $relationship = new Relationship(); $relation = new Relation(); - $user = new User(); + $user = (new User())->setUsername(uniqid())->setEmail(uniqid() . '@foo.com'); $relationship->setRelation($relation); $relationship->setToPerson($personA); From c19d1ff0c75f03cb8b1ddb728ebc4b015a90d565 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 7 Sep 2023 16:08:18 +0200 Subject: [PATCH 27/91] php cs fixer --- ...AccompanyingPeriodParticipationHandler.php | 13 ++++- .../PersonMoveCenterHistoryHandler.php | 14 +++-- .../Handler/PersonMoveHouseholdHandler.php | 17 +++++-- .../Handler/PersonMoveRelationHandler.php | 13 ++++- .../Actions/Remove/PersonMove.php | 51 ++++++++++--------- .../Actions/Remove/PersonMoveManager.php | 18 +++++-- .../Remove/PersonMoveSqlHandlerInterface.php | 11 +++- .../Tests/Action/Remove/PersonMoveTest.php | 19 +++++-- 8 files changed, 110 insertions(+), 46 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index cb18bd4cd..53654f397 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -1,5 +1,14 @@ getId(), $from->getId(), $to->getId()); - $deleteSql = sprintf(<<getId()); diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index 220adcfc1..c4307259f 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -1,19 +1,25 @@ getId(), $from->getId(), $to->getId()); + SQL, $to->getId(), $from->getId(), $to->getId()); - $deleteSql = sprintf(<<getId()); - return [$sqlInsert, $deleteSql]; + return [$sqlInsert, $deleteSql]; } } diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php index 3454fce24..82ca0592c 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -1,5 +1,14 @@ getId(), $from->getId(), $to->getId(), $from->getId(), $from->getId(), $to->getId()); - $deleteSql = sprintf(<<getId(), $from->getId()); diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index c3ecd8ec1..067727078 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -37,7 +37,7 @@ class PersonMove { public function __construct( private EntityManagerInterface $em, - private PersonMoveManager $personMoveManager, + private PersonMoveManager $personMoveManager, private EventDispatcherInterface $eventDispatcher ) { } @@ -78,9 +78,9 @@ class PersonMove foreach ($metadata->getAssociationMappings() as $field => $mapping) { - if ($this->personMoveManager->hasHandler($metadata->getName(), $field)) { - $sqls = array_merge($sqls, $this->personMoveManager->getSqls($metadata->getName(), $field, $from, $to)); - continue; + if ($this->personMoveManager->hasHandler($metadata->getName(), $field)) { + $sqls = array_merge($sqls, $this->personMoveManager->getSqls($metadata->getName(), $field, $from, $to)); + continue; } if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities(), true)) { @@ -148,32 +148,28 @@ class PersonMove $tableName = ''; if (array_key_exists('joinTable', $mapping)) { - // there is a join_table: we have to find conflict + // there is a join_table: we have to find conflict $tableName = (null !== ($mapping['joinTable']['schema'] ?? null) ? $mapping['joinTable']['schema'] . '.' : '') . $mapping['joinTable']['name']; $sqlInsert = sprintf( - "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id - $to->getId(), - $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $from->getId() - ); + "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $to->getId(), + $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + ); $deleteSql = sprintf( - "DELETE FROM %s WHERE %s = %d", - $tableName, - $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id - $from->getId() - ); - - return [ - $sqlInsert, $deleteSql - ]; + "DELETE FROM %s WHERE %s = %d", + $tableName, + $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id + $from->getId() + ); foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); @@ -183,7 +179,12 @@ class PersonMove $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); } - } elseif (array_key_exists('joinColumns', $mapping)) { + return [ + $sqlInsert, $deleteSql + ]; + + } + if (array_key_exists('joinColumns', $mapping)) { $tableName = $this->getTableName($metadata); foreach ($mapping['joinColumns'] as $columns) { $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php index a7bd1188a..99d22c3bb 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php @@ -1,5 +1,14 @@ */ private iterable $handlers, - ) - { + ) { } /** @@ -20,7 +28,7 @@ class PersonMoveManager * @param string $field * @return bool */ - public function hasHandler(string $className, string $field): bool + public function hasHandler(string $className, string $field): bool { foreach ($this->handlers as $handler) { if ($handler->supports($className, $field)) { @@ -28,14 +36,14 @@ class PersonMoveManager } } - return false; + return false; } /** * @param class-string $className * @return array */ - public function getSqls(string $className, string $field, Person $from, Person $to): array + public function getSqls(string $className, string $field, Person $from, Person $to): array { foreach ($this->handlers as $handler) { if ($handler->supports($className, $field)) { diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php index 9958f59df..c1b47127d 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveSqlHandlerInterface.php @@ -1,5 +1,14 @@ */ diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index 14268160e..19820ae1e 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -1,5 +1,14 @@ em, $this->personMoveManager, $this->eventDispatcher); $sqls = $move->getSQL($personA, $personB); $this->em->getConnection()->transactional(function (Connection $conn) use ($personA, $personB, $sqls) { - foreach ($sqls as $sql) { - $conn->executeStatement($sql); - } + foreach ($sqls as $sql) { + $conn->executeStatement($sql); + } }); $personsByIdOfA = $this->em->createQuery("SELECT p FROM " . Person::class . " p WHERE p.id = :id") From 36ca0fcbfca98a88d090d62a2c88fb1dd2452334 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 8 Sep 2023 10:50:57 +0200 Subject: [PATCH 28/91] php cs fixer --- src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index f52d678df..a1b42f34d 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -678,7 +678,7 @@ final class SingleTaskController extends AbstractController return $form; } - private function buildFilterOrder($includeFilterByUser = true, $includeMissionType = false): FilterOrderHelper + private function buildFilterOrder($includeFilterByUser = true, $includeMissionType = false): FilterOrderHelper { $statuses = ['no-alert', 'warning', 'alert']; $statusTrans = [ From c1d70ec63e7b53f39685b1aa8982a52673fcb2a2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 11:23:21 +0200 Subject: [PATCH 29/91] try fix error cannot insert multiple commands into prepared statement --- ...sonMoveAccompanyingPeriodParticipationHandler.php | 4 ++-- .../Handler/PersonMoveCenterHistoryHandler.php | 9 +++++++-- .../Remove/Handler/PersonMoveHouseholdHandler.php | 4 ++-- .../Remove/Handler/PersonMoveRelationHandler.php | 2 +- .../ChillPersonBundle/Actions/Remove/PersonMove.php | 12 ++++++------ .../Controller/PersonDuplicateController.php | 1 + 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index 53654f397..1b4c07469 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -34,11 +34,11 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH WHERE person_id = %d AND (cpapp.startdate, COALESCE(cpapp.enddate, 'infinity'::date)) OVERLAPS (cpapp2.startdate, COALESCE(cpapp2.enddate, 'infinity'::date)) - ) + ); SQL, $to->getId(), $from->getId(), $to->getId()); $deleteSql = sprintf(<<<'SQL' - DELETE FROM chill_person_accompanying_period_participation WHERE person_id = %d + DELETE FROM chill_person_accompanying_period_participation WHERE person_id = %d; SQL, $from->getId()); return [$insertSql, $deleteSql]; diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index c4307259f..e8e811f1b 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -52,12 +52,17 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface } } - $sqlDelete = sprintf("delete FROM chill_person_person_center_history WHERE person_id = %d", $from->getId()); + $sqlDelete = sprintf(<<<'SQL' + DELETE FROM chill_person_person_center_history WHERE person_id = %d; + SQL, $from->getId()); $sqlStatements = [$sqlDelete]; if ((null !== $oldestDateA && null !== $oldestDateB) && $oldestDateA <= $oldestDateB) { - $sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s' WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); + + $sqlInsert = sprintf(<<<'SQL' + UPDATE chill_person_person_center_history SET startDate = '%s' WHERE id = %d; + SQL, $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId()); $sqlStatements = [$sqlInsert, $sqlDelete]; } diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php index 2b5514b9c..d617e12ed 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php @@ -34,11 +34,11 @@ class PersonMoveHouseholdHandler implements PersonMoveSqlHandlerInterface WHERE person_id = %d AND daterange(cphm.startdate, cphm.enddate) && daterange(cphm_inner.startdate, cphm_inner.enddate) - ) + ); SQL, $to->getId(), $from->getId(), $to->getId()); $deleteSql = sprintf(<<<'SQL' - DELETE FROM chill_person_household_members WHERE person_id = %d + DELETE FROM chill_person_household_members WHERE person_id = %d; SQL, $from->getId()); return [$sqlInsert, $deleteSql]; diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php index 82ca0592c..22c65a43d 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -34,7 +34,7 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface WHERE cpr2.fromperson_id = %d AND cpr2.toperson_id = %d OR cpr2.fromperson_id = %d AND cpr2.toperson_id = %d - ) + ); SQL, $from->getId(), $from->getId(), $to->getId(), $from->getId(), $from->getId(), $to->getId()); $deleteSql = sprintf(<<<'SQL' diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 067727078..8bce56c0e 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -107,11 +107,11 @@ class PersonMove $personMetadata = $this->em->getClassMetadata(Person::class); $sqls[] = sprintf( - 'DELETE FROM %s WHERE id = %d', + 'DELETE FROM %s WHERE id = %d;', $this->getTableName($personMetadata), $from->getId() ); - + return $sqls; } @@ -132,7 +132,7 @@ class PersonMove } return sprintf( - 'DELETE FROM %s WHERE %s', + 'DELETE FROM %s WHERE %s;', $this->getTableName($metadata), implode(' AND ', $conditions) ); @@ -153,7 +153,7 @@ class PersonMove . $mapping['joinTable']['name']; $sqlInsert = sprintf( - "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING", + "INSERT INTO %s (%s, %s) SELECT %d, %s FROM %s WHERE %s = %d ON CONFLICT DO NOTHING;", $tableName, $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id $mapping['joinTable']['joinColumns'][0]['name'], // something_else_id @@ -165,7 +165,7 @@ class PersonMove ); $deleteSql = sprintf( - "DELETE FROM %s WHERE %s = %d", + "DELETE FROM %s WHERE %s = %d;", $tableName, $mapping['joinTable']['inverseJoinColumns'][0]['name'], // person_id $from->getId() @@ -196,7 +196,7 @@ class PersonMove } return [sprintf( - 'UPDATE %s SET %s WHERE %s', + 'UPDATE %s SET %s WHERE %s;', $tableName, implode(' ', $sets), implode(' AND ', $conditions) diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index 7ade542e0..31ec67a40 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -120,6 +120,7 @@ class PersonDuplicateController extends Controller $connection->beginTransaction(); foreach ($sqls as $sql) { + dump($sql); $connection->executeQuery($sql); } $connection->commit(); From 74645c065be9afaf98b9ce0daad59a75996a0add Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 13:01:43 +0200 Subject: [PATCH 30/91] use different logic to decide whether mission type filter should be shown --- .../Controller/SingleTaskController.php | 54 +++++++------------ .../SingleTaskAclAwareRepository.php | 2 +- .../Repository/SingleTaskRepository.php | 24 +++++++++ 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index a1b42f34d..347028fed 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -26,6 +26,7 @@ use Chill\TaskBundle\Event\TaskEvent; use Chill\TaskBundle\Event\UI\UIEvent; use Chill\TaskBundle\Form\SingleTaskType; use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface; +use Chill\TaskBundle\Repository\SingleTaskRepository; use Chill\TaskBundle\Repository\SingleTaskStateRepository; use Chill\TaskBundle\Security\Authorization\TaskVoter; use LogicException; @@ -48,41 +49,18 @@ use function array_merge; final class SingleTaskController extends AbstractController { - private CenterResolverDispatcherInterface $centerResolverDispatcher; - - private EventDispatcherInterface $eventDispatcher; - - private FilterOrderHelperFactoryInterface $filterOrderHelperFactory; - - private LoggerInterface $logger; - - private PaginatorFactory $paginatorFactory; - - private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository; - - private TimelineBuilder $timelineBuilder; - - private TranslatorInterface $translator; - public function __construct( - CenterResolverDispatcherInterface $centerResolverDispatcher, - PaginatorFactory $paginatorFactory, - SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository, - TranslatorInterface $translator, - EventDispatcherInterface $eventDispatcher, - TimelineBuilder $timelineBuilder, - LoggerInterface $logger, - FilterOrderHelperFactoryInterface $filterOrderHelperFactory, - private SingleTaskStateRepository $singleTaskStateRepository + private CenterResolverDispatcherInterface $centerResolverDispatcher, + private PaginatorFactory $paginatorFactory, + private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository, + private TranslatorInterface $translator, + private EventDispatcherInterface $eventDispatcher, + private TimelineBuilder $timelineBuilder, + private LoggerInterface $logger, + private FilterOrderHelperFactoryInterface $filterOrderHelperFactory, + private SingleTaskStateRepository $singleTaskStateRepository, + private SingleTaskRepository $singleTaskRepository ) { - $this->eventDispatcher = $eventDispatcher; - $this->timelineBuilder = $timelineBuilder; - $this->logger = $logger; - $this->translator = $translator; - $this->centerResolverDispatcher = $centerResolverDispatcher; - $this->paginatorFactory = $paginatorFactory; - $this->singleTaskAclAwareRepository = $singleTaskAclAwareRepository; - $this->filterOrderHelperFactory = $filterOrderHelperFactory; } /** @@ -300,7 +278,7 @@ final class SingleTaskController extends AbstractController ) { $this->denyAccessUnlessGranted(TaskVoter::SHOW, null); - $showMissionTypeFilter = $this->getParameter('show_mission_type_filter'); + $showMissionTypeFilter = $this->singleTaskRepository->countByDistinctTypes() > 2 ? true : false; $filterOrder = $this->buildFilterOrder(true, $showMissionTypeFilter); @@ -706,8 +684,12 @@ final class SingleTaskController extends AbstractController } if ($includeMissionType) { - $missionTypes = $this->getParameter('task_types'); - $filterBuilder->addCheckbox('missionTypePicker', $missionTypes); + $missionTypes = $this->singleTaskRepository->findAllTasktypes(); + foreach ($missionTypes as $type) { + $arrayOfTypes[] = $type['type']; + } + + $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); } return $filterBuilder->build(); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index c8f989765..3d2f3786c 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -82,7 +82,7 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository return $qb; } - if (null !== $types && count($types) > 0) { + if (null !== $types && count($types) > 0) { $qb->andWhere($qb->expr()->in('t.type', ':types')); $qb->setParameter('types', $types); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index e3eb634cd..53637f35a 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -306,4 +306,28 @@ class SingleTaskRepository extends EntityRepository ->add($qb->expr()->isNull('st.endDate')) ->add($qb->expr()->isNull('st.warningInterval')); } + + public function countByDistinctTypes() + { + $qb = $this->createQueryBuilder('st') + ->select('COUNT(DISTINCT st.type)'); + + $this->buildQuery($qb, []); + + return (int) $qb + ->getQuery() + ->getSingleScalarResult(); + } + + public function findAllTasktypes() + { + $qb = $this->createQueryBuilder('st') + ->select('DISTINCT st.type'); + + $this->buildQuery($qb, []); + + return $qb + ->getQuery() + ->getResult(); + } } From f770664798fdae25e355060011bfd40c9a3ed7ef Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 13:06:07 +0200 Subject: [PATCH 31/91] phpstan fix --- src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 347028fed..f74669fab 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -664,6 +664,7 @@ final class SingleTaskController extends AbstractController 'Tasks near deadline', 'Tasks over deadline', ]; + $arrayOfTypes = []; $filterBuilder = $this->filterOrderHelperFactory ->create(self::class) From efd43c379168da6188005a579030b273383a8e2e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 13:53:09 +0200 Subject: [PATCH 32/91] refactor code after review --- .../Controller/SingleTaskController.php | 11 +++++++---- .../Repository/SingleTaskRepository.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index f74669fab..2e2f145ef 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -278,7 +278,7 @@ final class SingleTaskController extends AbstractController ) { $this->denyAccessUnlessGranted(TaskVoter::SHOW, null); - $showMissionTypeFilter = $this->singleTaskRepository->countByDistinctTypes() > 2 ? true : false; + $showMissionTypeFilter = $this->singleTaskRepository->countByDistinctTypes() > 1; $filterOrder = $this->buildFilterOrder(true, $showMissionTypeFilter); @@ -685,12 +685,15 @@ final class SingleTaskController extends AbstractController } if ($includeMissionType) { - $missionTypes = $this->singleTaskRepository->findAllTasktypes(); +/* $missionTypes = $this->singleTaskRepository->findAllTasktypes(); foreach ($missionTypes as $type) { $arrayOfTypes[] = $type['type']; - } + }*/ - $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); +// $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); + $filterBuilder->addCheckbox('missionTypePicker', array_map( + fn ($row) => $row['type'], $this->singleTaskRepository->findAllTaskDistinctTypes()) + ); } return $filterBuilder->build(); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index 53637f35a..9b0f6c87d 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -319,7 +319,7 @@ class SingleTaskRepository extends EntityRepository ->getSingleScalarResult(); } - public function findAllTasktypes() + public function findAllTaskDistinctTypes() { $qb = $this->createQueryBuilder('st') ->select('DISTINCT st.type'); From 0355699a69c8dbe72abf80ffa16181d68cef9ef3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 13:53:40 +0200 Subject: [PATCH 33/91] php cs fix --- .../Controller/SingleTaskController.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 2e2f145ef..8a6dcc43b 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -685,14 +685,18 @@ final class SingleTaskController extends AbstractController } if ($includeMissionType) { -/* $missionTypes = $this->singleTaskRepository->findAllTasktypes(); - foreach ($missionTypes as $type) { - $arrayOfTypes[] = $type['type']; - }*/ + /* $missionTypes = $this->singleTaskRepository->findAllTasktypes(); + foreach ($missionTypes as $type) { + $arrayOfTypes[] = $type['type']; + }*/ -// $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); - $filterBuilder->addCheckbox('missionTypePicker', array_map( - fn ($row) => $row['type'], $this->singleTaskRepository->findAllTaskDistinctTypes()) + // $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); + $filterBuilder->addCheckbox( + 'missionTypePicker', + array_map( + fn ($row) => $row['type'], + $this->singleTaskRepository->findAllTaskDistinctTypes() + ) ); } From 86315b15793328ec3766973ed959abb4d46679f5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 14:43:52 +0200 Subject: [PATCH 34/91] only show active centers from the reachable centers for creation of person --- src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php | 4 +++- src/Bundle/ChillMainBundle/config/routes.yaml | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index 83e957623..6a82818f6 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -61,6 +61,8 @@ class PickCenterType extends AbstractType { $centers = $this->getReachableCenters($options['role'], $options['scopes']); + $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); + if (count($centers) <= 1) { $multiple = $options['choice_options']['multiple'] ?? false; $builder->add('center', HiddenType::class); @@ -75,7 +77,7 @@ class PickCenterType extends AbstractType $options['choice_options'], [ 'class' => Center::class, - 'choices' => $centers, + 'choices' => $centersActive, ] ) ); diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index 7e2af7a7f..5bbc381d1 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -10,10 +10,6 @@ chill_main_admin_scope: resource: "@ChillMainBundle/config/routes/scope.yaml" prefix: "{_locale}/admin/scope" -#chill_main_admin: -# resource: "@ChillMainBundle/config/routes/center.yaml" -# prefix: "{_locale}/admin/center" - chill_main_exports: resource: "@ChillMainBundle/config/routes/exports.yaml" prefix: "{_locale}/exports" From 4d111cd6cfdb106ce3e01b65ea4d1fd85c964d3b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 16:37:27 +0200 Subject: [PATCH 35/91] filter out active centers in api --- .../ChillPersonBundle/Controller/PersonApiController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index 505f307e6..896c1a79d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\Entity\Address; +use Chill\MainBundle\Entity\Center; use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper; use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Entity\Person; @@ -52,11 +53,13 @@ class PersonApiController extends ApiController { $centers = $this->authorizedCenterOnPersonCreation->getCenters(); + $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); + return $this->json( - ['showCenters' => $this->showCenters, 'centers' => $centers], + ['showCenters' => $this->showCenters, 'centers' => $centersActive], Response::HTTP_OK, [], - ['gropus' => ['read']] + ['groups' => ['read']] ); } From 6e2377b7eec782177bb77c8eaa14237007a15aab Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 12 Sep 2023 13:21:58 +0200 Subject: [PATCH 36/91] remove commented code --- .../ChillTaskBundle/Controller/SingleTaskController.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 8a6dcc43b..d9cd4dea0 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -685,12 +685,6 @@ final class SingleTaskController extends AbstractController } if ($includeMissionType) { - /* $missionTypes = $this->singleTaskRepository->findAllTasktypes(); - foreach ($missionTypes as $type) { - $arrayOfTypes[] = $type['type']; - }*/ - - // $filterBuilder->addCheckbox('missionTypePicker', $arrayOfTypes); $filterBuilder->addCheckbox( 'missionTypePicker', array_map( From 77180ebb0c7c72a7fcb3a01aca688f2f643e8c50 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 12 Sep 2023 14:19:10 +0200 Subject: [PATCH 37/91] Fix error in the doublons queries --- .../Remove/Handler/PersonMoveRelationHandler.php | 10 +++++----- .../ChillPersonBundle/Actions/Remove/PersonMove.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php index 22c65a43d..29f5f4199 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -37,11 +37,11 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface ); SQL, $from->getId(), $from->getId(), $to->getId(), $from->getId(), $from->getId(), $to->getId()); - $deleteSql = sprintf(<<<'SQL' - DELETE FROM chill_person_relationships WHERE fromperson_id = %d; - DELETE FROM chill_person_relationships WHERE toperson_id = %d; - SQL, $from->getId(), $from->getId()); + $deleteSql = [ + sprintf("DELETE FROM chill_person_relationships WHERE fromperson_id = %d", $from->getId()), + sprintf("DELETE FROM chill_person_relationships WHERE toperson_id = %d" , $from->getId()) + ]; - return [$insertSql, $deleteSql]; + return [$insertSql, ...$deleteSql]; } } diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 8bce56c0e..8c155cb2a 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -111,7 +111,7 @@ class PersonMove $this->getTableName($personMetadata), $from->getId() ); - + return $sqls; } From 19789acbbe285c22402bd6ca62a33d6f73bd009c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 12 Sep 2023 15:18:03 +0200 Subject: [PATCH 38/91] php cs fixes --- src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php | 2 +- .../ChillPersonBundle/Controller/PersonApiController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index 6a82818f6..882b9f4fa 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -61,7 +61,7 @@ class PickCenterType extends AbstractType { $centers = $this->getReachableCenters($options['role'], $options['scopes']); - $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); + $centersActive = array_filter($centers, fn (Center $c) => $c->getIsActive()); if (count($centers) <= 1) { $multiple = $options['choice_options']['multiple'] ?? false; diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index 896c1a79d..0ca3bd94a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -53,10 +53,10 @@ class PersonApiController extends ApiController { $centers = $this->authorizedCenterOnPersonCreation->getCenters(); - $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); + // $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); return $this->json( - ['showCenters' => $this->showCenters, 'centers' => $centersActive], + ['showCenters' => $this->showCenters, 'centers' => $centers], Response::HTTP_OK, [], ['groups' => ['read']] From 57a1a49fac14d356868cc950fde08e7f7ea8386f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 12 Sep 2023 15:55:03 +0200 Subject: [PATCH 39/91] fix user filter not combining with other filters --- .../ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index 3d2f3786c..dcd026ffb 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -78,8 +78,6 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository if ($orXUser->count() > 0) { $qb->andWhere($orXUser); } - - return $qb; } if (null !== $types && count($types) > 0) { From c1a586dfb95b0432530633997960ef5d06849c57 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 12 Sep 2023 16:07:50 +0200 Subject: [PATCH 40/91] php cs fix --- .../Actions/Remove/Handler/PersonMoveRelationHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php index 29f5f4199..2c2f68ca9 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -39,8 +39,8 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface $deleteSql = [ sprintf("DELETE FROM chill_person_relationships WHERE fromperson_id = %d", $from->getId()), - sprintf("DELETE FROM chill_person_relationships WHERE toperson_id = %d" , $from->getId()) - ]; + sprintf("DELETE FROM chill_person_relationships WHERE toperson_id = %d", $from->getId()) + ]; return [$insertSql, ...$deleteSql]; } From b4f9501af51946a6ef62f198f0ff5b28743c41a3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 11:47:54 +0200 Subject: [PATCH 41/91] php cs fixes --- .../ChillActivityBundle.php | 4 +- .../Controller/ActivityController.php | 3 +- .../LinkedToACP/AvgActivityDuration.php | 4 +- .../Export/LinkedToACP/CountActivity.php | 4 +- .../Export/LinkedToPerson/CountActivity.php | 4 +- .../LinkedToPerson/StatActivityDuration.php | 4 +- .../Export/Export/ListActivityHelper.php | 4 +- ...PeriodHavingActivityBetweenDatesFilter.php | 3 +- .../Repository/ActivityACLAwareRepository.php | 3 +- .../ActivityDocumentACLAwareRepository.php | 3 +- ...anyingPeriodActivityGenericDocProvider.php | 3 +- .../PersonActivityGenericDocProvider.php | 3 +- .../src/ChillAsideActivityBundle.php | 4 +- .../Aggregator/ByLocationAggregator.php | 4 +- .../Export/AvgAsideActivityDuration.php | 4 +- .../src/Export/Export/CountAsideActivity.php | 4 +- .../src/Export/Export/ListAsideActivity.php | 4 +- .../Export/SumAsideActivityDuration.php | 4 +- .../src/Export/Filter/ByLocationFilter.php | 3 +- .../Connector/MSGraph/MSUserAbsenceReader.php | 3 +- .../Connector/MSGraph/MSUserAbsenceSync.php | 3 +- .../Connector/NullRemoteCalendarConnector.php | 20 ++----- .../DocGenerator/CalendarContextInterface.php | 4 +- ...anyingPeriodCalendarGenericDocProvider.php | 3 +- .../PersonCalendarGenericDocProvider.php | 3 +- .../Form/Type/CustomFieldsTitleType.php | 4 +- ...ericDocForAccompanyingPeriodController.php | 3 +- .../Controller/GenericDocForPerson.php | 3 +- .../GenericDoc/FetchQuery.php | 3 +- .../GenericDoc/GenericDocDTO.php | 3 +- ...anyingCourseDocumentGenericDocProvider.php | 3 +- .../PersonDocumentGenericDocProvider.php | 3 +- ...anyingCourseDocumentGenericDocRenderer.php | 3 +- .../Twig/GenericDocExtensionRuntime.php | 3 +- .../PersonDocumentACLAwareRepository.php | 3 +- .../ChillEventBundle/ChillEventBundle.php | 4 +- .../Repository/EventRepository.php | 4 +- .../ChillAMLIFamilyMembersBundle.php | 4 +- .../Controller/AbstractCRUDController.php | 4 +- .../CRUD/Controller/CRUDController.php | 56 +++++-------------- .../CRUD/Form/CRUDDeleteEntityForm.php | 4 +- .../Command/LoadPostalCodesCommand.php | 12 +--- .../Controller/LocationTypeController.php | 4 +- .../Controller/LoginController.php | 4 +- .../Controller/PermissionsGroupController.php | 3 +- .../Controller/UserExportController.php | 3 +- src/Bundle/ChillMainBundle/Entity/User.php | 4 +- .../Export/ExportFormHelper.php | 3 +- .../ChillMainBundle/Export/ListInterface.php | 4 +- .../Form/Type/Export/AggregatorType.php | 4 +- .../Form/Type/Export/FilterType.php | 4 +- .../Exception/NotificationHandlerNotFound.php | 4 +- .../ChillMainBundle/Redis/ChillRedis.php | 4 +- .../Search/ParsingException.php | 4 +- .../Authorization/AbstractChillVoter.php | 4 +- .../Authorization/ChillVoterInterface.php | 4 +- ...ollateAddressWithReferenceOrPostalCode.php | 3 +- ...ddressWithReferenceOrPostalCodeCronJob.php | 3 +- .../EntityInfo/ViewEntityInfoManager.php | 3 +- .../ShortMessage/NullShortMessageSender.php | 4 +- .../FilterOrderGetActiveFilterHelper.php | 3 +- .../Templating/Listing/FilterOrderHelper.php | 3 +- .../Templating/Listing/Templating.php | 3 +- .../PasswordRecover/TokenManagerTest.php | 4 +- .../Exception/HandlerNotFoundException.php | 4 +- .../migrations/Version20100000000000.php | 4 +- .../migrations/Version20220513151853.php | 4 +- .../AccompanyingPeriodStepChangeCronjob.php | 3 +- ...mpanyingPeriodStepChangeMessageHandler.php | 3 +- .../AccompanyingPeriodStepChanger.php | 3 +- .../AccompanyingCourseWorkController.php | 3 +- ...CourseWorkEvaluationDocumentController.php | 4 +- .../SocialWorkSocialActionApiController.php | 3 +- .../AccompanyingPeriodInfo.php | 3 +- .../JobWorkingOnCourseAggregator.php | 3 +- .../ScopeWorkingOnCourseAggregator.php | 3 +- .../UserWorkingOnCourseAggregator.php | 3 +- .../PersonAggregators/AgeAggregator.php | 3 +- .../PersonAggregators/CenterAggregator.php | 3 +- .../PersonAggregators/GenderAggregator.php | 4 +- .../Export/Export/ListAccompanyingPeriod.php | 3 +- .../Export/Export/ListPersonDuplicate.php | 4 +- ...istPersonWithAccompanyingPeriodDetails.php | 3 +- ...ccompanyingPeriodInfoWithinDatesFilter.php | 3 +- .../JobWorkingOnCourseFilter.php | 3 +- .../ScopeWorkingOnCourseFilter.php | 3 +- .../UserWorkingOnCourseFilter.php | 3 +- ...yingPeriodWorkEndDateBetweenDateFilter.php | 3 +- ...ngPeriodWorkStartDateBetweenDateFilter.php | 3 +- .../Helper/ListAccompanyingPeriodHelper.php | 3 +- .../Person/PersonCenterHistoryInterface.php | 4 +- .../PersonJsonNormalizerInterface.php | 4 +- ...companyingPeriodViewEntityInfoProvider.php | 3 +- ...PeriodWorkEvaluationGenericDocProvider.php | 3 +- ...PeriodWorkEvaluationGenericDocRenderer.php | 3 +- .../Import/SocialWorkMetadataInterface.php | 4 +- .../Entity/PersonRenderInterface.php | 4 +- .../Workflow/WorkflowEventSubscriberTest.php | 4 +- .../migrations/Version20160422000000.php | 4 +- .../migrations/Version20210419112619.php | 4 +- .../ChillReportBundle/ChillReportBundle.php | 4 +- .../Authorization/ReportVoterTest.php | 4 +- .../Repository/AbstractTaskRepository.php | 4 +- .../Repository/RecurringTaskRepository.php | 4 +- .../Repository/SingleTaskStateRepository.php | 3 +- .../Tests/Controller/TaskControllerTest.php | 4 +- .../Workflow/TaskWorkflowDefinition.php | 4 +- .../Search/ThirdPartyApiSearch.php | 4 +- .../ChillWopiBundle/src/ChillWopiBundle.php | 4 +- ...aultDataOnExportFilterAggregatorRector.php | 3 +- 110 files changed, 129 insertions(+), 333 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php index 5f872a7dc..a85ddbb75 100644 --- a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php +++ b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php @@ -13,6 +13,4 @@ namespace Chill\ActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillActivityBundle extends Bundle -{ -} +class ChillActivityBundle extends Bundle {} diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 17545c1af..d81e33bcc 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -72,8 +72,7 @@ final class ActivityController extends AbstractController private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly PaginatorFactory $paginatorFactory, - ) { - } + ) {} /** * Deletes a Activity entity. diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index 6930784d3..128704296 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -36,9 +36,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface $this->repository = $em->getRepository(Activity::class); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index d473a925a..28a318541 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -36,9 +36,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->repository = $em->getRepository(Activity::class); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php index 6360251b3..5b0fe2d2c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php @@ -32,9 +32,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->activityRepository = $activityRepository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index e68d47cd3..a679c4ac8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -50,9 +50,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface $this->activityRepository = $activityRepository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index fae6ea6a6..d1be2f662 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -104,9 +104,7 @@ class ListActivityHelper ->addGroupBy('location.id'); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getAllowedFormattersTypes() { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 27e012d0b..20d0452fa 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -23,8 +23,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function getTitle() { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 7925f861b..f9db5c158 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -47,8 +47,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos private EntityManagerInterface $em, private Security $security, private RequestStack $requestStack, - ) { - } + ) {} /** * @throws NonUniqueResultException diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php index ce70409ba..9cc57f93f 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php @@ -43,8 +43,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security - ) { - } + ) {} public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php index 334b5d2df..05be52e25 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php @@ -36,8 +36,7 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo private EntityManagerInterface $em, private Security $security, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php index cf96449ab..f4a7c4afa 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php @@ -29,8 +29,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php index 6917517b7..b0951e502 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php +++ b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php @@ -13,6 +13,4 @@ namespace Chill\AsideActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillAsideActivityBundle extends Bundle -{ -} +class ChillAsideActivityBundle extends Bundle {} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php index c6a35e3d7..360e30efb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php @@ -20,9 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByLocationAggregator implements AggregatorInterface { - public function __construct(private LocationRepository $locationRepository) - { - } + public function __construct(private LocationRepository $locationRepository) {} /** * @inheritDoc diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 2b28062f6..351cbb4ea 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -31,9 +31,7 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 91210f764..a8bfcc3a2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -31,9 +31,7 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index 93b0c495d..b43ee6e01 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -72,9 +72,7 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface $this->translatableStringHelper = $translatableStringHelper; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 741f129f1..87f4a3dc3 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -31,9 +31,7 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php index f2808eca1..a1f51273c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php @@ -26,8 +26,7 @@ final readonly class ByLocationFilter implements FilterInterface { public function __construct( private Security $security - ) { - } + ) {} /** * @inheritDoc diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index c3632d2db..a81ef34c3 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php @@ -28,8 +28,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface private HttpClientInterface $machineHttpClient, private MapCalendarToUser $mapCalendarToUser, private ClockInterface $clock, - ) { - } + ) {} /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php index 10bf21b9b..a54fa217f 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php @@ -21,8 +21,7 @@ readonly class MSUserAbsenceSync private MSUserAbsenceReaderInterface $absenceReader, private ClockInterface $clock, private LoggerInterface $logger, - ) { - } + ) {} public function syncUserAbsence(User $user): void { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php index 211810abf..c8fb569e8 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php @@ -48,23 +48,13 @@ class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface return []; } - public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void - { - } + public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void {} - public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void - { - } + public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {} - public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void - { - } + public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {} - public function syncCalendarRange(CalendarRange $calendarRange): void - { - } + public function syncCalendarRange(CalendarRange $calendarRange): void {} - public function syncInvite(Invite $invite): void - { - } + public function syncInvite(Invite $invite): void {} } diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php index 527203003..74393a422 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php @@ -23,6 +23,4 @@ use Symfony\Component\Form\FormBuilderInterface; * @extends DocGeneratorContextWithPublicFormInterface * @extends DocGeneratorContextWithAdminFormInterface */ -interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface -{ -} +interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface {} diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php index 1040f9f0a..530843723 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php @@ -39,8 +39,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $em - ) { - } + ) {} /** * @throws MappingException diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php index f5d4b3cbb..8bc2d4c4c 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php @@ -39,8 +39,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private EntityManagerInterface $em - ) { - } + ) {} private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php index fa462737e..5d5377a15 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php @@ -16,9 +16,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomFieldsTitleType extends AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) - { - } + public function buildForm(FormBuilderInterface $builder, array $options) {} public function getBlockPrefix() { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php index 9a0650b2d..a686aa35c 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php @@ -31,8 +31,7 @@ final readonly class GenericDocForAccompanyingPeriodController private PaginatorFactory $paginator, private Security $security, private EngineInterface $twig, - ) { - } + ) {} /** * @param AccompanyingPeriod $accompanyingPeriod diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php index e010c41c5..841d49425 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php @@ -30,8 +30,7 @@ final readonly class GenericDocForPerson private PaginatorFactory $paginator, private Security $security, private EngineInterface $twig, - ) { - } + ) {} /** * @throws \Doctrine\DBAL\Exception diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php index b1631bb24..22c51ccff 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php @@ -54,8 +54,7 @@ class FetchQuery implements FetchQueryInterface private array $selectIdentifierTypes = [], private array $selectDateParams = [], private array $selectDateTypes = [], - ) { - } + ) {} public function addJoinClause(string $sql, array $params = [], array $types = []): int { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php index fe9bf7e4f..7307f0d6a 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php @@ -21,8 +21,7 @@ final readonly class GenericDocDTO public array $identifiers, public \DateTimeImmutable $docDate, public AccompanyingPeriod|Person $linked, - ) { - } + ) {} public function getContext(): string { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php index fe03a8b00..d268636f6 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php @@ -32,8 +32,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php index 613f8d758..60d247f0c 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php @@ -28,8 +28,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForPerson( Person $person, diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php index c32620030..1912c326d 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php @@ -24,8 +24,7 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen public function __construct( private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository, private PersonDocumentRepository $personDocumentRepository, - ) { - } + ) {} public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php index 8bb97a9b9..f1a605d77 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php @@ -25,8 +25,7 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter * @var list */ private iterable $renderers, - ) { - } + ) {} /** * @throws RuntimeError diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index 12506581c..bd39ba992 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -38,8 +38,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security, - ) { - } + ) {} public function buildQueryByPerson(Person $person): QueryBuilder { diff --git a/src/Bundle/ChillEventBundle/ChillEventBundle.php b/src/Bundle/ChillEventBundle/ChillEventBundle.php index d5a1b43cf..9754f397f 100644 --- a/src/Bundle/ChillEventBundle/ChillEventBundle.php +++ b/src/Bundle/ChillEventBundle/ChillEventBundle.php @@ -13,6 +13,4 @@ namespace Chill\EventBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillEventBundle extends Bundle -{ -} +class ChillEventBundle extends Bundle {} diff --git a/src/Bundle/ChillEventBundle/Repository/EventRepository.php b/src/Bundle/ChillEventBundle/Repository/EventRepository.php index d24841d5c..c696709db 100644 --- a/src/Bundle/ChillEventBundle/Repository/EventRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/EventRepository.php @@ -16,6 +16,4 @@ use Doctrine\ORM\EntityRepository; /** * Class EventRepository. */ -class EventRepository extends EntityRepository -{ -} +class EventRepository extends EntityRepository {} diff --git a/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php b/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php index 73a9713bd..ae86371ed 100644 --- a/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php +++ b/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php @@ -13,6 +13,4 @@ namespace Chill\FamilyMembersBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillAMLIFamilyMembersBundle extends Bundle -{ -} +class ChillAMLIFamilyMembersBundle extends Bundle {} diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index 4bc9b4d79..64cdec59a 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -150,9 +150,7 @@ abstract class AbstractCRUDController extends AbstractController return new $class(); } - protected function customizeQuery(string $action, Request $request, $query): void - { - } + protected function customizeQuery(string $action, Request $request, $query): void {} protected function getActionConfig(string $action) { diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 730ac32c1..9b206f566 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -242,13 +242,9 @@ class CRUDController extends AbstractController /** * Customize the form created by createFormFor. */ - protected function customizeForm(string $action, FormInterface $form) - { - } + protected function customizeForm(string $action, FormInterface $form) {} - protected function customizeQuery(string $action, Request $request, $query): void - { - } + protected function customizeQuery(string $action, Request $request, $query): void {} /** * @param $id @@ -927,9 +923,7 @@ class CRUDController extends AbstractController } } - protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) - { - } + protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {} /** * @param $action @@ -952,77 +946,55 @@ class CRUDController extends AbstractController /** * @param $entity */ - protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {} /** * method used by indexAction. * * @param mixed $query */ - protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) - { - } + protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) {} /** * method used by indexAction. * * @param mixed $entities */ - protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) - { - } + protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) {} /** * @param $entity */ - protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {} /** * @param $entity */ - protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {} - protected function onPreDelete(string $action, Request $request) - { - } + protected function onPreDelete(string $action, Request $request) {} /** * @param $entity */ - protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {} - protected function onPreIndex(string $action, Request $request) - { - } + protected function onPreIndex(string $action, Request $request) {} /** * method used by indexAction. */ - protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) - { - } + protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {} /** * @param $entity */ - protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {} /** * @param $entity */ - protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {} /** * Add ordering fields in the query build by self::queryEntities. diff --git a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php index 3ff3cf134..95f81ae05 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php +++ b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php @@ -16,6 +16,4 @@ use Symfony\Component\Form\AbstractType; /** * Class CRUDDeleteEntityForm. */ -class CRUDDeleteEntityForm extends AbstractType -{ -} +class CRUDDeleteEntityForm extends AbstractType {} diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index ea42fde78..334ed50a7 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -213,14 +213,8 @@ class LoadPostalCodesCommand extends Command } } -class ExistingPostalCodeException extends Exception -{ -} +class ExistingPostalCodeException extends Exception {} -class CountryCodeNotFoundException extends Exception -{ -} +class CountryCodeNotFoundException extends Exception {} -class PostalCodeNotValidException extends Exception -{ -} +class PostalCodeNotValidException extends Exception {} diff --git a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php index bc28f9d12..418f49578 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\CRUDController; -class LocationTypeController extends CRUDController -{ -} +class LocationTypeController extends CRUDController {} diff --git a/src/Bundle/ChillMainBundle/Controller/LoginController.php b/src/Bundle/ChillMainBundle/Controller/LoginController.php index 8a2468745..8c467dac1 100644 --- a/src/Bundle/ChillMainBundle/Controller/LoginController.php +++ b/src/Bundle/ChillMainBundle/Controller/LoginController.php @@ -44,7 +44,5 @@ class LoginController extends AbstractController ]); } - public function LoginCheckAction(Request $request) - { - } + public function LoginCheckAction(Request $request) {} } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 97e80916c..a745994ab 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -50,8 +50,7 @@ final class PermissionsGroupController extends AbstractController private readonly EntityManagerInterface $em, private readonly PermissionsGroupRepository $permissionsGroupRepository, private readonly RoleScopeRepository $roleScopeRepository, - ) { - } + ) {} /** */ diff --git a/src/Bundle/ChillMainBundle/Controller/UserExportController.php b/src/Bundle/ChillMainBundle/Controller/UserExportController.php index 530ac19b7..f15f79bf0 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserExportController.php @@ -27,8 +27,7 @@ final readonly class UserExportController private UserRepositoryInterface $userRepository, private Security $security, private TranslatorInterface $translator, - ) { - } + ) {} /** * @throws \League\Csv\CannotInsertRecord diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 35b73786b..0c6ba65f8 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -175,9 +175,7 @@ class User implements UserInterface return $this; } - public function eraseCredentials() - { - } + public function eraseCredentials() {} public function getAbsenceStart(): ?DateTimeImmutable { diff --git a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php index 5271fb223..e21ea7f4d 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php +++ b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php @@ -26,8 +26,7 @@ final readonly class ExportFormHelper private AuthorizationHelperForCurrentUserInterface $authorizationHelper, private ExportManager $exportManager, private FormFactoryInterface $formFactory, - ) { - } + ) {} public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array { diff --git a/src/Bundle/ChillMainBundle/Export/ListInterface.php b/src/Bundle/ChillMainBundle/Export/ListInterface.php index 53442f0e7..9b88525ca 100644 --- a/src/Bundle/ChillMainBundle/Export/ListInterface.php +++ b/src/Bundle/ChillMainBundle/Export/ListInterface.php @@ -20,6 +20,4 @@ namespace Chill\MainBundle\Export; * * When used, the `ExportManager` will not handle aggregator for this class. */ -interface ListInterface extends ExportInterface -{ -} +interface ListInterface extends ExportInterface {} diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php index 1ea01d5f8..cfcf4a471 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php @@ -19,9 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AggregatorType extends AbstractType { - public function __construct() - { - } + public function __construct() {} public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php index 7994881d5..cc2ee6e0c 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php @@ -21,9 +21,7 @@ class FilterType extends AbstractType { public const ENABLED_FIELD = 'enabled'; - public function __construct() - { - } + public function __construct() {} public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php index 61eafd312..3063d190e 100644 --- a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php +++ b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Notification\Exception; use RuntimeException; -class NotificationHandlerNotFound extends RuntimeException -{ -} +class NotificationHandlerNotFound extends RuntimeException {} diff --git a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php index 5070f77fd..b3a8570d8 100644 --- a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php +++ b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php @@ -16,6 +16,4 @@ use Redis; /** * Redis client configured by chill main. */ -class ChillRedis extends Redis -{ -} +class ChillRedis extends Redis {} diff --git a/src/Bundle/ChillMainBundle/Search/ParsingException.php b/src/Bundle/ChillMainBundle/Search/ParsingException.php index b54afef6a..550535d73 100644 --- a/src/Bundle/ChillMainBundle/Search/ParsingException.php +++ b/src/Bundle/ChillMainBundle/Search/ParsingException.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Search; use Exception; -class ParsingException extends Exception -{ -} +class ParsingException extends Exception {} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php index 02ffc9122..934a80956 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php @@ -24,6 +24,4 @@ use const E_USER_DEPRECATED; * * This abstract Voter provide generic methods to handle object specific to Chill */ -abstract class AbstractChillVoter extends Voter implements ChillVoterInterface -{ -} +abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php index 2ed1856d2..f8b0102c7 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php @@ -14,6 +14,4 @@ namespace Chill\MainBundle\Security\Authorization; /** * Provides methods for compiling voter and build admin role fields. */ -interface ChillVoterInterface -{ -} +interface ChillVoterInterface {} diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php index 2a26034ce..4d4c4ec10 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php @@ -101,8 +101,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA public function __construct( private Connection $connection, private LoggerInterface $logger, - ) { - } + ) {} /** * @throws \Throwable diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php index d2c9fc960..ed055a3c3 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php @@ -22,8 +22,7 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C public function __construct( private ClockInterface $clock, private CollateAddressWithReferenceOrPostalCodeInterface $collateAddressWithReferenceOrPostalCode, - ) { - } + ) {} public function canRun(?CronJobExecution $cronJobExecution): bool { diff --git a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php index 6b7b81224..f88f38d19 100644 --- a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php +++ b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php @@ -21,8 +21,7 @@ class ViewEntityInfoManager */ private iterable $vienEntityInfoProviders, private Connection $connection, - ) { - } + ) {} public function synchronizeOnDB(): void { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php index 82dea7bc6..16bc87790 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php @@ -20,7 +20,5 @@ namespace Chill\MainBundle\Service\ShortMessage; class NullShortMessageSender implements ShortMessageSenderInterface { - public function send(ShortMessage $shortMessage): void - { - } + public function send(ShortMessage $shortMessage): void {} } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php index 5b36e52b3..0aa8594f9 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php @@ -22,8 +22,7 @@ final readonly class FilterOrderGetActiveFilterHelper private TranslatorInterface $translator, private PropertyAccessorInterface $propertyAccessor, private UserRender $userRender, - ) { - } + ) {} /** * Return all the data required to display the active filters diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index 8bcc7ffae..309db574c 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -54,8 +54,7 @@ final class FilterOrderHelper public function __construct( private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack, - ) { - } + ) {} public function addSingleCheckbox(string $name, string $label): self { diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php index 2d32813cb..63b556283 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php @@ -25,8 +25,7 @@ class Templating extends AbstractExtension public function __construct( private readonly RequestStack $requestStack, private readonly FilterOrderGetActiveFilterHelper $filterOrderGetActiveFilterHelper, - ) { - } + ) {} public function getFilters(): array { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php index 1fee5b4be..e3d2b1f07 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php @@ -36,9 +36,7 @@ final class TokenManagerTest extends KernelTestCase $this->tokenManager = new TokenManager('secret', $logger); } - public static function setUpBefore() - { - } + public static function setUpBefore() {} public function testGenerate() { diff --git a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php index ab3d2c98c..d6b5c0c8f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php +++ b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Workflow\Exception; use RuntimeException; -class HandlerNotFoundException extends RuntimeException -{ -} +class HandlerNotFoundException extends RuntimeException {} diff --git a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php index 5ae675b51..55f5a6420 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php @@ -16,9 +16,7 @@ use Doctrine\Migrations\AbstractMigration; class Version20100000000000 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function up(Schema $schema): void { diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php index c46b40ee5..4bd9bd18f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php @@ -16,9 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220513151853 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function getDescription(): string { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 2ddf3415c..0d362c581 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -20,8 +20,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface public function __construct( private ClockInterface $clock, private AccompanyingPeriodStepChangeRequestor $requestor, - ) { - } + ) {} public function canRun(?CronJobExecution $cronJobExecution): bool { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php index 4a9873c6d..a40ac9880 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php @@ -23,8 +23,7 @@ class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterf public function __construct( private AccompanyingPeriodRepository $accompanyingPeriodRepository, private AccompanyingPeriodStepChanger $changer, - ) { - } + ) {} public function __invoke(AccompanyingPeriodStepChangeRequestMessage $message): void { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php index 05dfee6db..b8fb49c7c 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php @@ -30,8 +30,7 @@ class AccompanyingPeriodStepChanger private EntityManagerInterface $entityManager, private LoggerInterface $logger, private Registry $workflowRegistry, - ) { - } + ) {} public function __invoke(AccompanyingPeriod $period, string $transition, ?string $workflowName = null): void { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 66d020ad1..eb41341f6 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -43,8 +43,7 @@ final class AccompanyingCourseWorkController extends AbstractController private readonly LoggerInterface $chillLogger, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory - ) { - } + ) {} /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php index b9daf5a09..9e6602b3a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php @@ -20,9 +20,7 @@ use Symfony\Component\Security\Core\Security; class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController { - public function __construct(private Security $security) - { - } + public function __construct(private Security $security) {} /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index ae70d55f9..ddd9310b3 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -28,8 +28,7 @@ final class SocialWorkSocialActionApiController extends ApiController private readonly SocialIssueRepository $socialIssueRepository, private readonly PaginatorFactory $paginator, private readonly ClockInterface $clock, - ) { - } + ) {} public function listBySocialIssueApi($id, Request $request) { diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php index 795247eda..7a762e487 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php @@ -74,6 +74,5 @@ class AccompanyingPeriodInfo * @ORM\Column(type="text") */ public readonly string $discriminator, - ) { - } + ) {} } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index e93300e85..46489069d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -27,8 +27,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function __construct( private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index b9f493af9..a5b2f10f0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -28,8 +28,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function __construct( private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index b4941fa01..862a2de79 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -27,8 +27,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac public function __construct( private UserRender $userRender, private UserRepositoryInterface $userRepository, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index e3d364fa2..772087487 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -24,8 +24,7 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 9be0b0c7e..99187264a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -28,8 +28,7 @@ final readonly class CenterAggregator implements AggregatorInterface public function __construct( private CenterRepositoryInterface $centerRepository, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index dbe3d19d3..aae54fd47 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -45,9 +45,7 @@ final class GenderAggregator implements AggregatorInterface return Declarations::PERSON_TYPE; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index ab9c0db2f..4c8c0cae8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -52,8 +52,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, private ListAccompanyingPeriodHelper $listAccompanyingPeriodHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index e7c105604..82f7507c5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -146,9 +146,7 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat return PersonVoter::DUPLICATE; } - public function validateForm($data, ExecutionContextInterface $context) - { - } + public function validateForm($data, ExecutionContextInterface $context) {} protected function getHeaders(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php index ddb16bb2d..66d4d1530 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php @@ -50,8 +50,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte private ListAccompanyingPeriodHelper $listAccompanyingPeriodHelper, private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php index d50622502..f50fd6575 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php @@ -30,8 +30,7 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php index 63a668b6d..142cfd307 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php @@ -38,8 +38,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface private UserJobRepositoryInterface $userJobRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php index b9787bf52..6aef4e3da 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php @@ -40,8 +40,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface private ScopeRepositoryInterface $scopeRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php index 1f9bfc61a..0147890ad 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php @@ -33,8 +33,7 @@ readonly class UserWorkingOnCourseFilter implements FilterInterface public function __construct( private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index e78b1d021..4e50f2ed7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -24,8 +24,7 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php index 947e6c57c..5e56b9898 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php @@ -24,8 +24,7 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php index 5fa2252cd..9fc538a86 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php @@ -75,8 +75,7 @@ final readonly class ListAccompanyingPeriodHelper private SocialIssueRender $socialIssueRender, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator, - ) { - } + ) {} public function getQueryKeys($data) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php index c1bb427fd..fc5d0606d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php @@ -13,6 +13,4 @@ namespace Chill\PersonBundle\Repository\Person; use Doctrine\Persistence\ObjectRepository; -interface PersonCenterHistoryInterface extends ObjectRepository -{ -} +interface PersonCenterHistoryInterface extends ObjectRepository {} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php index 96f9ea934..36ec86966 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php @@ -19,6 +19,4 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ interface PersonJsonNormalizerInterface extends DenormalizerInterface, - NormalizerInterface -{ -} + NormalizerInterface {} diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php index ce9128896..9cfcc2a19 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php @@ -21,8 +21,7 @@ class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProvider */ private iterable $unions, private AccompanyingPeriodInfoQueryBuilder $builder, - ) { - } + ) {} public function getViewQuery(): string { diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php index f8b99a048..84de67576 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php @@ -31,8 +31,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php index 9810fe7a1..f77beb283 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php @@ -21,8 +21,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen { public function __construct( private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository, - ) { - } + ) {} public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php index f61d22252..f31612606 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php @@ -11,6 +11,4 @@ declare(strict_types=1); namespace Chill\PersonBundle\Service\Import; -interface SocialWorkMetadataInterface extends ChillImporter -{ -} +interface SocialWorkMetadataInterface extends ChillImporter {} diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php index 2f69d31a9..203281b67 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php @@ -19,6 +19,4 @@ use Chill\PersonBundle\Entity\Person; * * @extends ChillEntityRenderInterface */ -interface PersonRenderInterface extends ChillEntityRenderInterface -{ -} +interface PersonRenderInterface extends ChillEntityRenderInterface {} diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php index 7dccb81e3..cc607ba4b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php @@ -17,6 +17,4 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; * @internal * @coversNothing */ -final class WorkflowEventSubscriberTest extends KernelTestCase -{ -} +final class WorkflowEventSubscriberTest extends KernelTestCase {} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php index 148ceee3a..4399b36d8 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php @@ -21,9 +21,7 @@ use function count; */ class Version20160422000000 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function up(Schema $schema): void { diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php index 8db3880ed..e713486d0 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php @@ -19,9 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419112619 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function getDescription(): string { diff --git a/src/Bundle/ChillReportBundle/ChillReportBundle.php b/src/Bundle/ChillReportBundle/ChillReportBundle.php index ef92fa192..76bc4c9b2 100644 --- a/src/Bundle/ChillReportBundle/ChillReportBundle.php +++ b/src/Bundle/ChillReportBundle/ChillReportBundle.php @@ -13,6 +13,4 @@ namespace Chill\ReportBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillReportBundle extends Bundle -{ -} +class ChillReportBundle extends Bundle {} diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 4179df56d..3255b2edc 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -43,9 +43,7 @@ final class ReportVoterTest extends KernelTestCase */ protected $voter; - public static function setUpBeforeClass(): void - { - } + public static function setUpBeforeClass(): void {} protected function setUp(): void { diff --git a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php index d19420580..6ac7f10ec 100644 --- a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php @@ -17,6 +17,4 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository -{ -} +abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository {} diff --git a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php index 4bbedd1bb..985aa9935 100644 --- a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php @@ -17,6 +17,4 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository -{ -} +class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository {} diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php index c0d596e09..4d8c0a88c 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php @@ -22,8 +22,7 @@ class SingleTaskStateRepository public function __construct( private Connection $connection - ) { - } + ) {} /** * Return a list of all states associated to at least one single task in the database diff --git a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php index 41832a25c..a309f9c49 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php @@ -17,6 +17,4 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; * @internal * @coversNothing */ -final class TaskControllerTest extends WebTestCase -{ -} +final class TaskControllerTest extends WebTestCase {} diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php index 76a8da7c8..81fea25e6 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php +++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php @@ -11,6 +11,4 @@ declare(strict_types=1); namespace Chill\TaskBundle\Workflow; -interface TaskWorkflowDefinition -{ -} +interface TaskWorkflowDefinition {} diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index 1d4e12074..ddce88f0a 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -61,9 +61,7 @@ class ThirdPartyApiSearch implements SearchApiInterface return $this->thirdPartyRepository->find($metadata['id']); } - public function prepare(array $metadatas): void - { - } + public function prepare(array $metadatas): void {} public function provideQuery(string $pattern, array $parameters): SearchApiQuery { diff --git a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php index 5ca164db1..401eb9970 100644 --- a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php +++ b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php @@ -13,6 +13,4 @@ namespace Chill\WopiBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -final class ChillWopiBundle extends Bundle -{ -} +final class ChillWopiBundle extends Bundle {} diff --git a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php index 4718aedac..12ba9179d 100644 --- a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php +++ b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php @@ -25,8 +25,7 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends Abstra { public function __construct( private readonly ClassAnalyzer $classAnalyzer, - ) { - } + ) {} public function getRuleDefinition(): RuleDefinition { From cf294541ae2e4e87a3af9c8b150f19631b1e6c50 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 12:11:28 +0200 Subject: [PATCH 42/91] Add a developer faq to the chill documentation --- docs/source/development/FAQ.rst | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/source/development/FAQ.rst diff --git a/docs/source/development/FAQ.rst b/docs/source/development/FAQ.rst new file mode 100644 index 000000000..ebbc1f9ea --- /dev/null +++ b/docs/source/development/FAQ.rst @@ -0,0 +1,36 @@ +.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled "GNU +Free Documentation License". + +.. _faq: + + +Frequently asked questions +#################### + +Continuous integration +*********** + +Pipeline fails, but php-cs-fixer doesn't alert me when running it locally ? +======================================== + +It is possible that you run php-cs-fixer on your local instance of chill and no fixes are made. +Everything seems fine, so you push. However once the pipeline is run in gitlab, you're notified that it failed due to php +cs errors. + +In this case it's likely that you have to update your version of php-cs-fixer. +php-cs-fixer is installed when building the docker image: https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/src/branch/main/Dockerfile#L50 + +Consequently, to update php-cs-fixer we have to update the image by building it again. + +For this the following commands can be used, + +.. code-block:: php + +docker compose build --pull php +# replace existing containers +docker compose up -d --force-recreate php From 15fbfbb6219567e00f8033485915139761a4b562 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 12:17:01 +0200 Subject: [PATCH 43/91] add developer faq in the index + some language corrections --- docs/source/development/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/development/index.rst b/docs/source/development/index.rst index 768d29ce0..d48f92890 100644 --- a/docs/source/development/index.rst +++ b/docs/source/development/index.rst @@ -9,7 +9,7 @@ Development ########### -As Chill rely on the `symfony `_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and things we provide to encounter our needs. +As Chill relies on the `symfony `_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered. .. toctree:: :maxdepth: 2 @@ -37,6 +37,7 @@ As Chill rely on the `symfony `_ framework, reading the fram Cron Jobs Info about entities Info about database (in French) + Developer FAQ Layout and UI ************** From 754515f18564a99888fda16741a341166e2cbd0e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 12:25:56 +0200 Subject: [PATCH 44/91] php cs fixes --- .../ChillActivityBundle.php | 4 +- .../Controller/ActivityController.php | 3 +- .../LinkedToACP/AvgActivityDuration.php | 4 +- .../Export/LinkedToACP/CountActivity.php | 4 +- .../Export/LinkedToPerson/CountActivity.php | 4 +- .../LinkedToPerson/StatActivityDuration.php | 4 +- .../Export/Export/ListActivityHelper.php | 4 +- ...PeriodHavingActivityBetweenDatesFilter.php | 3 +- .../Repository/ActivityACLAwareRepository.php | 3 +- .../ActivityDocumentACLAwareRepository.php | 3 +- ...anyingPeriodActivityGenericDocProvider.php | 3 +- .../PersonActivityGenericDocProvider.php | 3 +- .../src/ChillAsideActivityBundle.php | 4 +- .../Aggregator/ByLocationAggregator.php | 4 +- .../Export/AvgAsideActivityDuration.php | 4 +- .../src/Export/Export/CountAsideActivity.php | 4 +- .../src/Export/Export/ListAsideActivity.php | 4 +- .../Export/SumAsideActivityDuration.php | 4 +- .../src/Export/Filter/ByLocationFilter.php | 3 +- .../Connector/MSGraph/MSUserAbsenceReader.php | 3 +- .../Connector/MSGraph/MSUserAbsenceSync.php | 3 +- .../Connector/NullRemoteCalendarConnector.php | 20 ++----- .../DocGenerator/CalendarContextInterface.php | 4 +- ...anyingPeriodCalendarGenericDocProvider.php | 3 +- .../PersonCalendarGenericDocProvider.php | 3 +- .../Form/Type/CustomFieldsTitleType.php | 4 +- ...ericDocForAccompanyingPeriodController.php | 3 +- .../Controller/GenericDocForPerson.php | 3 +- .../GenericDoc/FetchQuery.php | 3 +- .../GenericDoc/GenericDocDTO.php | 3 +- ...anyingCourseDocumentGenericDocProvider.php | 3 +- .../PersonDocumentGenericDocProvider.php | 3 +- ...anyingCourseDocumentGenericDocRenderer.php | 3 +- .../Twig/GenericDocExtensionRuntime.php | 3 +- .../PersonDocumentACLAwareRepository.php | 3 +- .../ChillEventBundle/ChillEventBundle.php | 4 +- .../Repository/EventRepository.php | 4 +- .../ChillAMLIFamilyMembersBundle.php | 4 +- .../Controller/AbstractCRUDController.php | 4 +- .../CRUD/Controller/CRUDController.php | 56 +++++-------------- .../CRUD/Form/CRUDDeleteEntityForm.php | 4 +- .../Command/LoadPostalCodesCommand.php | 12 +--- .../Controller/LocationTypeController.php | 4 +- .../Controller/LoginController.php | 4 +- .../Controller/PermissionsGroupController.php | 3 +- .../Controller/UserExportController.php | 3 +- src/Bundle/ChillMainBundle/Entity/User.php | 4 +- .../Export/ExportFormHelper.php | 3 +- .../ChillMainBundle/Export/ListInterface.php | 4 +- .../Form/Type/Export/AggregatorType.php | 4 +- .../Form/Type/Export/FilterType.php | 4 +- .../Exception/NotificationHandlerNotFound.php | 4 +- .../ChillMainBundle/Redis/ChillRedis.php | 4 +- .../Search/ParsingException.php | 4 +- .../Authorization/AbstractChillVoter.php | 4 +- .../Authorization/ChillVoterInterface.php | 4 +- ...ollateAddressWithReferenceOrPostalCode.php | 3 +- ...ddressWithReferenceOrPostalCodeCronJob.php | 3 +- .../EntityInfo/ViewEntityInfoManager.php | 3 +- .../ShortMessage/NullShortMessageSender.php | 4 +- .../FilterOrderGetActiveFilterHelper.php | 3 +- .../Templating/Listing/FilterOrderHelper.php | 3 +- .../Templating/Listing/Templating.php | 3 +- .../PasswordRecover/TokenManagerTest.php | 4 +- .../Exception/HandlerNotFoundException.php | 4 +- .../migrations/Version20100000000000.php | 4 +- .../migrations/Version20220513151853.php | 4 +- .../AccompanyingPeriodStepChangeCronjob.php | 3 +- ...mpanyingPeriodStepChangeMessageHandler.php | 3 +- .../AccompanyingPeriodStepChanger.php | 3 +- .../AccompanyingCourseWorkController.php | 3 +- ...CourseWorkEvaluationDocumentController.php | 4 +- .../SocialWorkSocialActionApiController.php | 3 +- .../AccompanyingPeriodInfo.php | 3 +- .../JobWorkingOnCourseAggregator.php | 3 +- .../ScopeWorkingOnCourseAggregator.php | 3 +- .../UserWorkingOnCourseAggregator.php | 3 +- .../PersonAggregators/AgeAggregator.php | 3 +- .../PersonAggregators/CenterAggregator.php | 3 +- .../PersonAggregators/GenderAggregator.php | 4 +- .../Export/Export/ListAccompanyingPeriod.php | 3 +- .../Export/Export/ListPersonDuplicate.php | 4 +- ...istPersonWithAccompanyingPeriodDetails.php | 3 +- ...ccompanyingPeriodInfoWithinDatesFilter.php | 3 +- .../JobWorkingOnCourseFilter.php | 3 +- .../ScopeWorkingOnCourseFilter.php | 3 +- .../UserWorkingOnCourseFilter.php | 3 +- ...yingPeriodWorkEndDateBetweenDateFilter.php | 3 +- ...ngPeriodWorkStartDateBetweenDateFilter.php | 3 +- .../Helper/ListAccompanyingPeriodHelper.php | 3 +- .../Person/PersonCenterHistoryInterface.php | 4 +- .../PersonJsonNormalizerInterface.php | 4 +- ...companyingPeriodViewEntityInfoProvider.php | 3 +- ...PeriodWorkEvaluationGenericDocProvider.php | 3 +- ...PeriodWorkEvaluationGenericDocRenderer.php | 3 +- .../Import/SocialWorkMetadataInterface.php | 4 +- .../Entity/PersonRenderInterface.php | 4 +- .../Workflow/WorkflowEventSubscriberTest.php | 4 +- .../migrations/Version20160422000000.php | 4 +- .../migrations/Version20210419112619.php | 4 +- .../ChillReportBundle/ChillReportBundle.php | 4 +- .../Authorization/ReportVoterTest.php | 4 +- .../Repository/AbstractTaskRepository.php | 4 +- .../Repository/RecurringTaskRepository.php | 4 +- .../Repository/SingleTaskStateRepository.php | 3 +- .../Tests/Controller/TaskControllerTest.php | 4 +- .../Workflow/TaskWorkflowDefinition.php | 4 +- .../Search/ThirdPartyApiSearch.php | 4 +- .../ChillWopiBundle/src/ChillWopiBundle.php | 4 +- ...aultDataOnExportFilterAggregatorRector.php | 3 +- 110 files changed, 129 insertions(+), 333 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php index 5f872a7dc..a85ddbb75 100644 --- a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php +++ b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php @@ -13,6 +13,4 @@ namespace Chill\ActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillActivityBundle extends Bundle -{ -} +class ChillActivityBundle extends Bundle {} diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 17545c1af..d81e33bcc 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -72,8 +72,7 @@ final class ActivityController extends AbstractController private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly PaginatorFactory $paginatorFactory, - ) { - } + ) {} /** * Deletes a Activity entity. diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index 6930784d3..128704296 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -36,9 +36,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface $this->repository = $em->getRepository(Activity::class); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index d473a925a..28a318541 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -36,9 +36,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->repository = $em->getRepository(Activity::class); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php index 6360251b3..5b0fe2d2c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php @@ -32,9 +32,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->activityRepository = $activityRepository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index e68d47cd3..a679c4ac8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -50,9 +50,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface $this->activityRepository = $activityRepository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index fae6ea6a6..d1be2f662 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -104,9 +104,7 @@ class ListActivityHelper ->addGroupBy('location.id'); } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getAllowedFormattersTypes() { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 27e012d0b..20d0452fa 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -23,8 +23,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function getTitle() { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 7925f861b..f9db5c158 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -47,8 +47,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos private EntityManagerInterface $em, private Security $security, private RequestStack $requestStack, - ) { - } + ) {} /** * @throws NonUniqueResultException diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php index ce70409ba..9cc57f93f 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php @@ -43,8 +43,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security - ) { - } + ) {} public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php index 334b5d2df..05be52e25 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php @@ -36,8 +36,7 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo private EntityManagerInterface $em, private Security $security, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php index cf96449ab..f4a7c4afa 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php @@ -29,8 +29,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php index 6917517b7..b0951e502 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php +++ b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php @@ -13,6 +13,4 @@ namespace Chill\AsideActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillAsideActivityBundle extends Bundle -{ -} +class ChillAsideActivityBundle extends Bundle {} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php index c6a35e3d7..360e30efb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php @@ -20,9 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByLocationAggregator implements AggregatorInterface { - public function __construct(private LocationRepository $locationRepository) - { - } + public function __construct(private LocationRepository $locationRepository) {} /** * @inheritDoc diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 2b28062f6..351cbb4ea 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -31,9 +31,7 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 91210f764..a8bfcc3a2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -31,9 +31,7 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index 93b0c495d..b43ee6e01 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -72,9 +72,7 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface $this->translatableStringHelper = $translatableStringHelper; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 741f129f1..87f4a3dc3 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -31,9 +31,7 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac $this->repository = $repository; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php index f2808eca1..a1f51273c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php @@ -26,8 +26,7 @@ final readonly class ByLocationFilter implements FilterInterface { public function __construct( private Security $security - ) { - } + ) {} /** * @inheritDoc diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index c3632d2db..a81ef34c3 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php @@ -28,8 +28,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface private HttpClientInterface $machineHttpClient, private MapCalendarToUser $mapCalendarToUser, private ClockInterface $clock, - ) { - } + ) {} /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php index 10bf21b9b..a54fa217f 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php @@ -21,8 +21,7 @@ readonly class MSUserAbsenceSync private MSUserAbsenceReaderInterface $absenceReader, private ClockInterface $clock, private LoggerInterface $logger, - ) { - } + ) {} public function syncUserAbsence(User $user): void { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php index 211810abf..c8fb569e8 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php @@ -48,23 +48,13 @@ class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface return []; } - public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void - { - } + public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void {} - public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void - { - } + public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {} - public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void - { - } + public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {} - public function syncCalendarRange(CalendarRange $calendarRange): void - { - } + public function syncCalendarRange(CalendarRange $calendarRange): void {} - public function syncInvite(Invite $invite): void - { - } + public function syncInvite(Invite $invite): void {} } diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php index 527203003..74393a422 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php @@ -23,6 +23,4 @@ use Symfony\Component\Form\FormBuilderInterface; * @extends DocGeneratorContextWithPublicFormInterface * @extends DocGeneratorContextWithAdminFormInterface */ -interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface -{ -} +interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface {} diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php index 1040f9f0a..530843723 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php @@ -39,8 +39,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $em - ) { - } + ) {} /** * @throws MappingException diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php index f5d4b3cbb..8bc2d4c4c 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php @@ -39,8 +39,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private EntityManagerInterface $em - ) { - } + ) {} private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php index fa462737e..5d5377a15 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php @@ -16,9 +16,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomFieldsTitleType extends AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) - { - } + public function buildForm(FormBuilderInterface $builder, array $options) {} public function getBlockPrefix() { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php index 9a0650b2d..a686aa35c 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php @@ -31,8 +31,7 @@ final readonly class GenericDocForAccompanyingPeriodController private PaginatorFactory $paginator, private Security $security, private EngineInterface $twig, - ) { - } + ) {} /** * @param AccompanyingPeriod $accompanyingPeriod diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php index e010c41c5..841d49425 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php @@ -30,8 +30,7 @@ final readonly class GenericDocForPerson private PaginatorFactory $paginator, private Security $security, private EngineInterface $twig, - ) { - } + ) {} /** * @throws \Doctrine\DBAL\Exception diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php index b1631bb24..22c51ccff 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php @@ -54,8 +54,7 @@ class FetchQuery implements FetchQueryInterface private array $selectIdentifierTypes = [], private array $selectDateParams = [], private array $selectDateTypes = [], - ) { - } + ) {} public function addJoinClause(string $sql, array $params = [], array $types = []): int { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php index fe9bf7e4f..7307f0d6a 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php @@ -21,8 +21,7 @@ final readonly class GenericDocDTO public array $identifiers, public \DateTimeImmutable $docDate, public AccompanyingPeriod|Person $linked, - ) { - } + ) {} public function getContext(): string { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php index fe03a8b00..d268636f6 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php @@ -32,8 +32,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php index 613f8d758..60d247f0c 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php @@ -28,8 +28,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository, - ) { - } + ) {} public function buildFetchQueryForPerson( Person $person, diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php index c32620030..1912c326d 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php @@ -24,8 +24,7 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen public function __construct( private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository, private PersonDocumentRepository $personDocumentRepository, - ) { - } + ) {} public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php index 8bb97a9b9..f1a605d77 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php @@ -25,8 +25,7 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter * @var list */ private iterable $renderers, - ) { - } + ) {} /** * @throws RuntimeError diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index 12506581c..bd39ba992 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -38,8 +38,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security, - ) { - } + ) {} public function buildQueryByPerson(Person $person): QueryBuilder { diff --git a/src/Bundle/ChillEventBundle/ChillEventBundle.php b/src/Bundle/ChillEventBundle/ChillEventBundle.php index d5a1b43cf..9754f397f 100644 --- a/src/Bundle/ChillEventBundle/ChillEventBundle.php +++ b/src/Bundle/ChillEventBundle/ChillEventBundle.php @@ -13,6 +13,4 @@ namespace Chill\EventBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillEventBundle extends Bundle -{ -} +class ChillEventBundle extends Bundle {} diff --git a/src/Bundle/ChillEventBundle/Repository/EventRepository.php b/src/Bundle/ChillEventBundle/Repository/EventRepository.php index d24841d5c..c696709db 100644 --- a/src/Bundle/ChillEventBundle/Repository/EventRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/EventRepository.php @@ -16,6 +16,4 @@ use Doctrine\ORM\EntityRepository; /** * Class EventRepository. */ -class EventRepository extends EntityRepository -{ -} +class EventRepository extends EntityRepository {} diff --git a/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php b/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php index 73a9713bd..ae86371ed 100644 --- a/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php +++ b/src/Bundle/ChillFamilyMembersBundle/ChillAMLIFamilyMembersBundle.php @@ -13,6 +13,4 @@ namespace Chill\FamilyMembersBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillAMLIFamilyMembersBundle extends Bundle -{ -} +class ChillAMLIFamilyMembersBundle extends Bundle {} diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index 4bc9b4d79..64cdec59a 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -150,9 +150,7 @@ abstract class AbstractCRUDController extends AbstractController return new $class(); } - protected function customizeQuery(string $action, Request $request, $query): void - { - } + protected function customizeQuery(string $action, Request $request, $query): void {} protected function getActionConfig(string $action) { diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 730ac32c1..9b206f566 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -242,13 +242,9 @@ class CRUDController extends AbstractController /** * Customize the form created by createFormFor. */ - protected function customizeForm(string $action, FormInterface $form) - { - } + protected function customizeForm(string $action, FormInterface $form) {} - protected function customizeQuery(string $action, Request $request, $query): void - { - } + protected function customizeQuery(string $action, Request $request, $query): void {} /** * @param $id @@ -927,9 +923,7 @@ class CRUDController extends AbstractController } } - protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) - { - } + protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {} /** * @param $action @@ -952,77 +946,55 @@ class CRUDController extends AbstractController /** * @param $entity */ - protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {} /** * method used by indexAction. * * @param mixed $query */ - protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) - { - } + protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) {} /** * method used by indexAction. * * @param mixed $entities */ - protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) - { - } + protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) {} /** * @param $entity */ - protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {} /** * @param $entity */ - protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {} - protected function onPreDelete(string $action, Request $request) - { - } + protected function onPreDelete(string $action, Request $request) {} /** * @param $entity */ - protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {} - protected function onPreIndex(string $action, Request $request) - { - } + protected function onPreIndex(string $action, Request $request) {} /** * method used by indexAction. */ - protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) - { - } + protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {} /** * @param $entity */ - protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {} /** * @param $entity */ - protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) - { - } + protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {} /** * Add ordering fields in the query build by self::queryEntities. diff --git a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php index 3ff3cf134..95f81ae05 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php +++ b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php @@ -16,6 +16,4 @@ use Symfony\Component\Form\AbstractType; /** * Class CRUDDeleteEntityForm. */ -class CRUDDeleteEntityForm extends AbstractType -{ -} +class CRUDDeleteEntityForm extends AbstractType {} diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index ea42fde78..334ed50a7 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -213,14 +213,8 @@ class LoadPostalCodesCommand extends Command } } -class ExistingPostalCodeException extends Exception -{ -} +class ExistingPostalCodeException extends Exception {} -class CountryCodeNotFoundException extends Exception -{ -} +class CountryCodeNotFoundException extends Exception {} -class PostalCodeNotValidException extends Exception -{ -} +class PostalCodeNotValidException extends Exception {} diff --git a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php index bc28f9d12..418f49578 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\CRUDController; -class LocationTypeController extends CRUDController -{ -} +class LocationTypeController extends CRUDController {} diff --git a/src/Bundle/ChillMainBundle/Controller/LoginController.php b/src/Bundle/ChillMainBundle/Controller/LoginController.php index 8a2468745..8c467dac1 100644 --- a/src/Bundle/ChillMainBundle/Controller/LoginController.php +++ b/src/Bundle/ChillMainBundle/Controller/LoginController.php @@ -44,7 +44,5 @@ class LoginController extends AbstractController ]); } - public function LoginCheckAction(Request $request) - { - } + public function LoginCheckAction(Request $request) {} } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 97e80916c..a745994ab 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -50,8 +50,7 @@ final class PermissionsGroupController extends AbstractController private readonly EntityManagerInterface $em, private readonly PermissionsGroupRepository $permissionsGroupRepository, private readonly RoleScopeRepository $roleScopeRepository, - ) { - } + ) {} /** */ diff --git a/src/Bundle/ChillMainBundle/Controller/UserExportController.php b/src/Bundle/ChillMainBundle/Controller/UserExportController.php index 530ac19b7..f15f79bf0 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserExportController.php @@ -27,8 +27,7 @@ final readonly class UserExportController private UserRepositoryInterface $userRepository, private Security $security, private TranslatorInterface $translator, - ) { - } + ) {} /** * @throws \League\Csv\CannotInsertRecord diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 35b73786b..0c6ba65f8 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -175,9 +175,7 @@ class User implements UserInterface return $this; } - public function eraseCredentials() - { - } + public function eraseCredentials() {} public function getAbsenceStart(): ?DateTimeImmutable { diff --git a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php index 5271fb223..e21ea7f4d 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php +++ b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php @@ -26,8 +26,7 @@ final readonly class ExportFormHelper private AuthorizationHelperForCurrentUserInterface $authorizationHelper, private ExportManager $exportManager, private FormFactoryInterface $formFactory, - ) { - } + ) {} public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array { diff --git a/src/Bundle/ChillMainBundle/Export/ListInterface.php b/src/Bundle/ChillMainBundle/Export/ListInterface.php index 53442f0e7..9b88525ca 100644 --- a/src/Bundle/ChillMainBundle/Export/ListInterface.php +++ b/src/Bundle/ChillMainBundle/Export/ListInterface.php @@ -20,6 +20,4 @@ namespace Chill\MainBundle\Export; * * When used, the `ExportManager` will not handle aggregator for this class. */ -interface ListInterface extends ExportInterface -{ -} +interface ListInterface extends ExportInterface {} diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php index 1ea01d5f8..cfcf4a471 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php @@ -19,9 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AggregatorType extends AbstractType { - public function __construct() - { - } + public function __construct() {} public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php index 7994881d5..cc2ee6e0c 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php @@ -21,9 +21,7 @@ class FilterType extends AbstractType { public const ENABLED_FIELD = 'enabled'; - public function __construct() - { - } + public function __construct() {} public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php index 61eafd312..3063d190e 100644 --- a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php +++ b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Notification\Exception; use RuntimeException; -class NotificationHandlerNotFound extends RuntimeException -{ -} +class NotificationHandlerNotFound extends RuntimeException {} diff --git a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php index 5070f77fd..b3a8570d8 100644 --- a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php +++ b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php @@ -16,6 +16,4 @@ use Redis; /** * Redis client configured by chill main. */ -class ChillRedis extends Redis -{ -} +class ChillRedis extends Redis {} diff --git a/src/Bundle/ChillMainBundle/Search/ParsingException.php b/src/Bundle/ChillMainBundle/Search/ParsingException.php index b54afef6a..550535d73 100644 --- a/src/Bundle/ChillMainBundle/Search/ParsingException.php +++ b/src/Bundle/ChillMainBundle/Search/ParsingException.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Search; use Exception; -class ParsingException extends Exception -{ -} +class ParsingException extends Exception {} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php index 02ffc9122..934a80956 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php @@ -24,6 +24,4 @@ use const E_USER_DEPRECATED; * * This abstract Voter provide generic methods to handle object specific to Chill */ -abstract class AbstractChillVoter extends Voter implements ChillVoterInterface -{ -} +abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php index 2ed1856d2..f8b0102c7 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php @@ -14,6 +14,4 @@ namespace Chill\MainBundle\Security\Authorization; /** * Provides methods for compiling voter and build admin role fields. */ -interface ChillVoterInterface -{ -} +interface ChillVoterInterface {} diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php index 2a26034ce..4d4c4ec10 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php @@ -101,8 +101,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA public function __construct( private Connection $connection, private LoggerInterface $logger, - ) { - } + ) {} /** * @throws \Throwable diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php index d2c9fc960..ed055a3c3 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php @@ -22,8 +22,7 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C public function __construct( private ClockInterface $clock, private CollateAddressWithReferenceOrPostalCodeInterface $collateAddressWithReferenceOrPostalCode, - ) { - } + ) {} public function canRun(?CronJobExecution $cronJobExecution): bool { diff --git a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php index 6b7b81224..f88f38d19 100644 --- a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php +++ b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php @@ -21,8 +21,7 @@ class ViewEntityInfoManager */ private iterable $vienEntityInfoProviders, private Connection $connection, - ) { - } + ) {} public function synchronizeOnDB(): void { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php index 82dea7bc6..16bc87790 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php @@ -20,7 +20,5 @@ namespace Chill\MainBundle\Service\ShortMessage; class NullShortMessageSender implements ShortMessageSenderInterface { - public function send(ShortMessage $shortMessage): void - { - } + public function send(ShortMessage $shortMessage): void {} } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php index 5b36e52b3..0aa8594f9 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php @@ -22,8 +22,7 @@ final readonly class FilterOrderGetActiveFilterHelper private TranslatorInterface $translator, private PropertyAccessorInterface $propertyAccessor, private UserRender $userRender, - ) { - } + ) {} /** * Return all the data required to display the active filters diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index 8bcc7ffae..309db574c 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -54,8 +54,7 @@ final class FilterOrderHelper public function __construct( private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack, - ) { - } + ) {} public function addSingleCheckbox(string $name, string $label): self { diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php index 2d32813cb..63b556283 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php @@ -25,8 +25,7 @@ class Templating extends AbstractExtension public function __construct( private readonly RequestStack $requestStack, private readonly FilterOrderGetActiveFilterHelper $filterOrderGetActiveFilterHelper, - ) { - } + ) {} public function getFilters(): array { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php index 1fee5b4be..e3d2b1f07 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php @@ -36,9 +36,7 @@ final class TokenManagerTest extends KernelTestCase $this->tokenManager = new TokenManager('secret', $logger); } - public static function setUpBefore() - { - } + public static function setUpBefore() {} public function testGenerate() { diff --git a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php index ab3d2c98c..d6b5c0c8f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php +++ b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php @@ -13,6 +13,4 @@ namespace Chill\MainBundle\Workflow\Exception; use RuntimeException; -class HandlerNotFoundException extends RuntimeException -{ -} +class HandlerNotFoundException extends RuntimeException {} diff --git a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php index 5ae675b51..55f5a6420 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php @@ -16,9 +16,7 @@ use Doctrine\Migrations\AbstractMigration; class Version20100000000000 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function up(Schema $schema): void { diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php index c46b40ee5..4bd9bd18f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php @@ -16,9 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220513151853 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function getDescription(): string { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 2ddf3415c..0d362c581 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -20,8 +20,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface public function __construct( private ClockInterface $clock, private AccompanyingPeriodStepChangeRequestor $requestor, - ) { - } + ) {} public function canRun(?CronJobExecution $cronJobExecution): bool { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php index 4a9873c6d..a40ac9880 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php @@ -23,8 +23,7 @@ class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterf public function __construct( private AccompanyingPeriodRepository $accompanyingPeriodRepository, private AccompanyingPeriodStepChanger $changer, - ) { - } + ) {} public function __invoke(AccompanyingPeriodStepChangeRequestMessage $message): void { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php index 05dfee6db..b8fb49c7c 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php @@ -30,8 +30,7 @@ class AccompanyingPeriodStepChanger private EntityManagerInterface $entityManager, private LoggerInterface $logger, private Registry $workflowRegistry, - ) { - } + ) {} public function __invoke(AccompanyingPeriod $period, string $transition, ?string $workflowName = null): void { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 66d020ad1..eb41341f6 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -43,8 +43,7 @@ final class AccompanyingCourseWorkController extends AbstractController private readonly LoggerInterface $chillLogger, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory - ) { - } + ) {} /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php index b9daf5a09..9e6602b3a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php @@ -20,9 +20,7 @@ use Symfony\Component\Security\Core\Security; class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController { - public function __construct(private Security $security) - { - } + public function __construct(private Security $security) {} /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index ae70d55f9..ddd9310b3 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -28,8 +28,7 @@ final class SocialWorkSocialActionApiController extends ApiController private readonly SocialIssueRepository $socialIssueRepository, private readonly PaginatorFactory $paginator, private readonly ClockInterface $clock, - ) { - } + ) {} public function listBySocialIssueApi($id, Request $request) { diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php index 795247eda..7a762e487 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php @@ -74,6 +74,5 @@ class AccompanyingPeriodInfo * @ORM\Column(type="text") */ public readonly string $discriminator, - ) { - } + ) {} } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index e93300e85..46489069d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -27,8 +27,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function __construct( private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index b9f493af9..a5b2f10f0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -28,8 +28,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function __construct( private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index b4941fa01..862a2de79 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -27,8 +27,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac public function __construct( private UserRender $userRender, private UserRepositoryInterface $userRepository, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index e3d364fa2..772087487 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -24,8 +24,7 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 9be0b0c7e..99187264a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -28,8 +28,7 @@ final readonly class CenterAggregator implements AggregatorInterface public function __construct( private CenterRepositoryInterface $centerRepository, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index dbe3d19d3..aae54fd47 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -45,9 +45,7 @@ final class GenderAggregator implements AggregatorInterface return Declarations::PERSON_TYPE; } - public function buildForm(FormBuilderInterface $builder) - { - } + public function buildForm(FormBuilderInterface $builder) {} public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index ab9c0db2f..4c8c0cae8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -52,8 +52,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, private ListAccompanyingPeriodHelper $listAccompanyingPeriodHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index e7c105604..82f7507c5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -146,9 +146,7 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat return PersonVoter::DUPLICATE; } - public function validateForm($data, ExecutionContextInterface $context) - { - } + public function validateForm($data, ExecutionContextInterface $context) {} protected function getHeaders(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php index ddb16bb2d..66d4d1530 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php @@ -50,8 +50,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte private ListAccompanyingPeriodHelper $listAccompanyingPeriodHelper, private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php index d50622502..f50fd6575 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php @@ -30,8 +30,7 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php index 63a668b6d..142cfd307 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php @@ -38,8 +38,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface private UserJobRepositoryInterface $userJobRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php index b9787bf52..6aef4e3da 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php @@ -40,8 +40,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface private ScopeRepositoryInterface $scopeRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php index 1f9bfc61a..0147890ad 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php @@ -33,8 +33,7 @@ readonly class UserWorkingOnCourseFilter implements FilterInterface public function __construct( private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index e78b1d021..4e50f2ed7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -24,8 +24,7 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php index 947e6c57c..5e56b9898 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php @@ -24,8 +24,7 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) { - } + ) {} public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php index 5fa2252cd..9fc538a86 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php @@ -75,8 +75,7 @@ final readonly class ListAccompanyingPeriodHelper private SocialIssueRender $socialIssueRender, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator, - ) { - } + ) {} public function getQueryKeys($data) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php index c1bb427fd..fc5d0606d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php @@ -13,6 +13,4 @@ namespace Chill\PersonBundle\Repository\Person; use Doctrine\Persistence\ObjectRepository; -interface PersonCenterHistoryInterface extends ObjectRepository -{ -} +interface PersonCenterHistoryInterface extends ObjectRepository {} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php index 96f9ea934..36ec86966 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php @@ -19,6 +19,4 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ interface PersonJsonNormalizerInterface extends DenormalizerInterface, - NormalizerInterface -{ -} + NormalizerInterface {} diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php index ce9128896..9cfcc2a19 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php @@ -21,8 +21,7 @@ class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProvider */ private iterable $unions, private AccompanyingPeriodInfoQueryBuilder $builder, - ) { - } + ) {} public function getViewQuery(): string { diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php index f8b99a048..84de67576 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php @@ -31,8 +31,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) { - } + ) {} public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php index 9810fe7a1..f77beb283 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php @@ -21,8 +21,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen { public function __construct( private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository, - ) { - } + ) {} public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php index f61d22252..f31612606 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php @@ -11,6 +11,4 @@ declare(strict_types=1); namespace Chill\PersonBundle\Service\Import; -interface SocialWorkMetadataInterface extends ChillImporter -{ -} +interface SocialWorkMetadataInterface extends ChillImporter {} diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php index 2f69d31a9..203281b67 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php @@ -19,6 +19,4 @@ use Chill\PersonBundle\Entity\Person; * * @extends ChillEntityRenderInterface */ -interface PersonRenderInterface extends ChillEntityRenderInterface -{ -} +interface PersonRenderInterface extends ChillEntityRenderInterface {} diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php index 7dccb81e3..cc607ba4b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Workflow/WorkflowEventSubscriberTest.php @@ -17,6 +17,4 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; * @internal * @coversNothing */ -final class WorkflowEventSubscriberTest extends KernelTestCase -{ -} +final class WorkflowEventSubscriberTest extends KernelTestCase {} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php index 148ceee3a..4399b36d8 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php @@ -21,9 +21,7 @@ use function count; */ class Version20160422000000 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function up(Schema $schema): void { diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php index 8db3880ed..e713486d0 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php @@ -19,9 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419112619 extends AbstractMigration { - public function down(Schema $schema): void - { - } + public function down(Schema $schema): void {} public function getDescription(): string { diff --git a/src/Bundle/ChillReportBundle/ChillReportBundle.php b/src/Bundle/ChillReportBundle/ChillReportBundle.php index ef92fa192..76bc4c9b2 100644 --- a/src/Bundle/ChillReportBundle/ChillReportBundle.php +++ b/src/Bundle/ChillReportBundle/ChillReportBundle.php @@ -13,6 +13,4 @@ namespace Chill\ReportBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillReportBundle extends Bundle -{ -} +class ChillReportBundle extends Bundle {} diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 4179df56d..3255b2edc 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -43,9 +43,7 @@ final class ReportVoterTest extends KernelTestCase */ protected $voter; - public static function setUpBeforeClass(): void - { - } + public static function setUpBeforeClass(): void {} protected function setUp(): void { diff --git a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php index d19420580..6ac7f10ec 100644 --- a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php @@ -17,6 +17,4 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository -{ -} +abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository {} diff --git a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php index 4bbedd1bb..985aa9935 100644 --- a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php @@ -17,6 +17,4 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository -{ -} +class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository {} diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php index c0d596e09..4d8c0a88c 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php @@ -22,8 +22,7 @@ class SingleTaskStateRepository public function __construct( private Connection $connection - ) { - } + ) {} /** * Return a list of all states associated to at least one single task in the database diff --git a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php index 41832a25c..a309f9c49 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php @@ -17,6 +17,4 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; * @internal * @coversNothing */ -final class TaskControllerTest extends WebTestCase -{ -} +final class TaskControllerTest extends WebTestCase {} diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php index 76a8da7c8..81fea25e6 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php +++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php @@ -11,6 +11,4 @@ declare(strict_types=1); namespace Chill\TaskBundle\Workflow; -interface TaskWorkflowDefinition -{ -} +interface TaskWorkflowDefinition {} diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index 1d4e12074..ddce88f0a 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -61,9 +61,7 @@ class ThirdPartyApiSearch implements SearchApiInterface return $this->thirdPartyRepository->find($metadata['id']); } - public function prepare(array $metadatas): void - { - } + public function prepare(array $metadatas): void {} public function provideQuery(string $pattern, array $parameters): SearchApiQuery { diff --git a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php index 5ca164db1..401eb9970 100644 --- a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php +++ b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php @@ -13,6 +13,4 @@ namespace Chill\WopiBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -final class ChillWopiBundle extends Bundle -{ -} +final class ChillWopiBundle extends Bundle {} diff --git a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php index 4718aedac..12ba9179d 100644 --- a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php +++ b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php @@ -25,8 +25,7 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends Abstra { public function __construct( private readonly ClassAnalyzer $classAnalyzer, - ) { - } + ) {} public function getRuleDefinition(): RuleDefinition { From 67e9127f8efcd8eac343c0ec430ba6519b67625d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 12:40:32 +0200 Subject: [PATCH 45/91] docs: correct code block display --- docs/source/development/FAQ.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/development/FAQ.rst b/docs/source/development/FAQ.rst index ebbc1f9ea..c0b7e37e8 100644 --- a/docs/source/development/FAQ.rst +++ b/docs/source/development/FAQ.rst @@ -31,6 +31,6 @@ For this the following commands can be used, .. code-block:: php -docker compose build --pull php -# replace existing containers -docker compose up -d --force-recreate php + docker compose build --pull php + # replace existing containers + docker compose up -d --force-recreate php From cd85e37c1bf02cabe011aca75dee54fa99146cee Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 14 Sep 2023 14:30:58 +0200 Subject: [PATCH 46/91] do active center filtering in frontend for person creation --- .../Serializer/Normalizer/CenterNormalizer.php | 1 + .../ChillPersonBundle/Controller/PersonApiController.php | 2 -- .../Resources/public/vuejs/_components/OnTheFly/Person.vue | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php index e0b2a3e96..578fc4ce2 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php @@ -63,6 +63,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface 'id' => $center->getId(), 'type' => 'center', 'name' => $center->getName(), + 'isActive' => $center->getIsActive() ]; } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index 0ca3bd94a..78dfc268c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -53,8 +53,6 @@ class PersonApiController extends ApiController { $centers = $this->authorizedCenterOnPersonCreation->getCenters(); - // $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); - return $this->json( ['showCenters' => $this->showCenters, 'centers' => $centers], Response::HTTP_OK, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index 16a76c780..46d78b77c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -329,12 +329,13 @@ export default { if (this.action !== 'create') { this.loadData(); } else { - console.log('show centers', this.showCenters); + // console.log('show centers', this.showCenters); getCentersForPersonCreation() .then(params => { - this.config.centers = params.centers; + this.config.centers = params.centers.filter(c => c.isActive); this.showCenters = params.showCenters; - console.log('show centers inside', this.showCenters); + // console.log('centers', this.config.centers) + // console.log('show centers inside', this.showCenters); if (this.showCenters && this.config.centers.length === 1) { this.person.center = this.config.centers[0]; } From bf7f375daf29add6b9341f2b5477c63f11e78166 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 22 Aug 2023 14:24:40 +0200 Subject: [PATCH 47/91] Fixed: [export] bad type in form of EmergencyFilter and CalendarRangeFilter --- .../Export/Filter/ACPFilters/EmergencyFilter.php | 6 +++--- .../Export/Filter/CalendarRangeFilter.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php index 807ba3903..66ab40e48 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php @@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; class EmergencyFilter implements FilterInterface { private const CHOICES = [ - 'activity is emergency' => true, - 'activity is not emergency' => false, + 'activity is emergency' => 'true', + 'activity is not emergency' => 'false', ]; - private const DEFAULT_CHOICE = false; + private const DEFAULT_CHOICE = 'false'; private TranslatorInterface $translator; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php index 5ffb7c01f..84ec77e6b 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php @@ -29,11 +29,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; class CalendarRangeFilter implements FilterInterface { private const CHOICES = [ - 'Not made within a calendar range' => true, - 'Made within a calendar range' => false, + 'Not made within a calendar range' => 'true', + 'Made within a calendar range' => 'false', ]; - private const DEFAULT_CHOICE = false; + private const DEFAULT_CHOICE = 'false'; private TranslatorInterface $translator; From 52c5807cd5fe0429c4ca83fc18738164cc9ade62 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 22 Aug 2023 14:28:35 +0200 Subject: [PATCH 48/91] add changie --- .changes/unreleased/Fixed-20230822-142809.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixed-20230822-142809.yaml diff --git a/.changes/unreleased/Fixed-20230822-142809.yaml b/.changes/unreleased/Fixed-20230822-142809.yaml new file mode 100644 index 000000000..b22477135 --- /dev/null +++ b/.changes/unreleased/Fixed-20230822-142809.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: "Corrects a typing error in 2 filters, which caused an \nerror when trying to + reedit a saved export\n\n" +time: 2023-08-22T14:28:09.485466139+02:00 +custom: + Issue: "135" From 2cec4a770ead6f88ea8ebf39f13952f05cdba627 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 24 Aug 2023 15:14:47 +0200 Subject: [PATCH 49/91] Fixed: [notificationMailer] invert 'if continue' condition inside foreach loop --- .changes/unreleased/Fixed-20230824-152038.yaml | 6 ++++++ .../Notification/Email/NotificationMailer.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixed-20230824-152038.yaml diff --git a/.changes/unreleased/Fixed-20230824-152038.yaml b/.changes/unreleased/Fixed-20230824-152038.yaml new file mode 100644 index 000000000..656bd4752 --- /dev/null +++ b/.changes/unreleased/Fixed-20230824-152038.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Fix who receive reply notification when adding comment (recipees must receive + it, and sender not). +time: 2023-08-24T15:20:38.472382872+02:00 +custom: + Issue: "137" diff --git a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php index 5290492b1..a652231ac 100644 --- a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php @@ -46,7 +46,7 @@ class NotificationMailer [$comment->getNotification()->getSender()] ) as $dest ) { - if (null === $dest->getEmail() || $comment->getCreatedBy() !== $dest) { + if (null !== $dest->getEmail() && $comment->getCreatedBy() === $dest) { continue; } $email = new TemplatedEmail(); From 65b585d4a9e158b3df7cb629de27e9dea17aea1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Sep 2023 15:47:45 +0200 Subject: [PATCH 50/91] Add test to NotificationMailer::postPersistComment --- .../Email/NotificationMailerTest.php | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php diff --git a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php new file mode 100644 index 000000000..47629b4b4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php @@ -0,0 +1,78 @@ +expectNotToPerformAssertions(); + $user1 = (new User())->setEmail('user1@foo.com'); + $user2 = (new User())->setEmail('user2@foo.com'); + $user3 = (new User())->setEmail('user3@foo.com'); + + $notification = new Notification(); + $notification + ->setTitle('test notification') + ->setSender($user1) + ->addAddressee($user2) + ->addAddressee($user3) + ; + + $comment = (new NotificationComment()) + ->setContent("foo bar baz") + ->setCreatedBy($user2) + ; + $notification->addComment($comment); + + $mailer = $this->prophesize(MailerInterface::class); + + // a mail only to user1 and user3 should have been sent + $mailer->send(Argument::that(function (Email $email) { + foreach ($email->getTo() as $address) { + if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') { + return true; + } + } + + return false; + })); + + $objectManager = $this->prophesize(EntityManagerInterface::class); + + $mailer = $this->buildNotificationMailer($mailer->reveal()); + $mailer->postPersistComment($comment, new PostPersistEventArgs($comment, $objectManager->reveal())); + } + + private function buildNotificationMailer( + MailerInterface $mailer = null, + ): NotificationMailer + { + return new NotificationMailer( + $mailer, + new NullLogger(), + new Translator('fr') + ); + } + + + +} From b4f8c7d261039e27437008974b90ab795d8ac782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Sep 2023 15:47:59 +0200 Subject: [PATCH 51/91] NotificationMailer: send to correct destinees --- .../unreleased/Fixed-20230824-152038.yaml | 6 ------ .../unreleased/Fixed-20230906-154856.yaml | 5 +++++ .../Notification/Email/NotificationMailer.php | 19 ++++++++++++------- 3 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 .changes/unreleased/Fixed-20230824-152038.yaml create mode 100644 .changes/unreleased/Fixed-20230906-154856.yaml diff --git a/.changes/unreleased/Fixed-20230824-152038.yaml b/.changes/unreleased/Fixed-20230824-152038.yaml deleted file mode 100644 index 656bd4752..000000000 --- a/.changes/unreleased/Fixed-20230824-152038.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Fixed -body: Fix who receive reply notification when adding comment (recipees must receive - it, and sender not). -time: 2023-08-24T15:20:38.472382872+02:00 -custom: - Issue: "137" diff --git a/.changes/unreleased/Fixed-20230906-154856.yaml b/.changes/unreleased/Fixed-20230906-154856.yaml new file mode 100644 index 000000000..73fb2dc48 --- /dev/null +++ b/.changes/unreleased/Fixed-20230906-154856.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Do not send an email to creator twice when adding a comment to a notification +time: 2023-09-06T15:48:56.991246312+02:00 +custom: + Issue: "" diff --git a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php index a652231ac..8facf00b9 100644 --- a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php @@ -40,13 +40,18 @@ class NotificationMailer public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void { - foreach ( - array_merge( - $comment->getNotification()->getAddressees()->toArray(), - [$comment->getNotification()->getSender()] - ) as $dest - ) { - if (null !== $dest->getEmail() && $comment->getCreatedBy() === $dest) { + $dests = [$comment->getNotification()->getSender(), ...$comment->getNotification()->getAddressees()->toArray()]; + + $uniqueDests = []; + foreach ($dests as $dest) { + // avoid duplication + if (in_array(spl_object_hash($dest), $uniqueDests, true)) { + continue; + } + $uniqueDests[] = spl_object_hash($dest); + + // do not send if the sender does not have any email, nor to the creator of the comment + if (null === $dest->getEmail() || $comment->getCreatedBy() === $dest) { continue; } $email = new TemplatedEmail(); From e7a9b10d0d173652b6fdd7b93d00442eb77d3a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Sep 2023 15:55:01 +0200 Subject: [PATCH 52/91] NotificationMailer: add tests when user does not have any email --- .../Email/NotificationMailerTest.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php index 47629b4b4..4c1ae5d42 100644 --- a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php @@ -62,6 +62,46 @@ class NotificationMailerTest extends TestCase $mailer->postPersistComment($comment, new PostPersistEventArgs($comment, $objectManager->reveal())); } + public function testPostPersistCommentDestWithNullEmail(): void + { + $this->expectNotToPerformAssertions(); + $user1 = (new User())->setEmail('user1@foo.com'); + $user2 = (new User())->setEmail('user2@foo.com'); + $user3 = (new User())->setEmail(null); + + $notification = new Notification(); + $notification + ->setTitle('test notification') + ->setSender($user1) + ->addAddressee($user2) + ->addAddressee($user3) + ; + + $comment = (new NotificationComment()) + ->setContent("foo bar baz") + ->setCreatedBy($user2) + ; + $notification->addComment($comment); + + $mailer = $this->prophesize(MailerInterface::class); + + // a mail only to user1 and user3 should have been sent + $mailer->send(Argument::that(function (Email $email) { + foreach ($email->getTo() as $address) { + if ($address->getAddress() === 'user1@foo.com') { + return true; + } + } + + return false; + })); + + $objectManager = $this->prophesize(EntityManagerInterface::class); + + $mailer = $this->buildNotificationMailer($mailer->reveal()); + $mailer->postPersistComment($comment, new PostPersistEventArgs($comment, $objectManager->reveal())); + } + private function buildNotificationMailer( MailerInterface $mailer = null, ): NotificationMailer From 6f1dd5b3f27f19c99115929b268c91324935071d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Sep 2023 16:18:28 +0200 Subject: [PATCH 53/91] Fix new CS --- .../ChillEventBundle/Search/EventSearch.php | 2 +- .../Email/NotificationMailerTest.php | 30 +++++++++++++------ .../Controller/PersonController.php | 2 +- .../AccompanyingPeriodContextTest.php | 2 +- .../DocGenerator/PersonContextTest.php | 2 +- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 6bb3d435d..504d04130 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -152,7 +152,7 @@ class EventSearch extends AbstractSearch $orWhere = $qb->expr()->orX(); foreach ($reachableCenters as $center) { - $n = $n+1; + $n = $n + 1; $circles = $this->authorizationHelper->getReachableScopes( $this->security->getUser(), 'CHILL_EVENT_SEE', diff --git a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php index 4c1ae5d42..19da87b79 100644 --- a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php @@ -1,5 +1,14 @@ setSender($user1) ->addAddressee($user2) ->addAddressee($user3) - ; + ; $comment = (new NotificationComment()) ->setContent("foo bar baz") @@ -47,14 +60,14 @@ class NotificationMailerTest extends TestCase // a mail only to user1 and user3 should have been sent $mailer->send(Argument::that(function (Email $email) { - foreach ($email->getTo() as $address) { - if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') { - return true; - } + foreach ($email->getTo() as $address) { + if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') { + return true; } + } - return false; - })); + return false; + })); $objectManager = $this->prophesize(EntityManagerInterface::class); @@ -104,8 +117,7 @@ class NotificationMailerTest extends TestCase private function buildNotificationMailer( MailerInterface $mailer = null, - ): NotificationMailer - { + ): NotificationMailer { return new NotificationMailer( $mailer, new NullLogger(), diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index 2d4732289..ce6d6bb38 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -214,7 +214,7 @@ final class PersonController extends AbstractController { $person = new Person(); - $authorizedCenters =$this->authorizationHelper->getReachableCenters($this->getUser(), PersonVoter::CREATE); + $authorizedCenters = $this->authorizationHelper->getReachableCenters($this->getUser(), PersonVoter::CREATE); if (1 === count($authorizedCenters)) { $person->setCenter($authorizedCenters[0]); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php index f9f888999..b5f656702 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php @@ -108,7 +108,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase ): void { $context = $this->buildContext(); $template = new DocGeneratorTemplate(); - $template->setName(["fr" =>"test"])->setContext(AccompanyingPeriodContext::class) + $template->setName(["fr" => "test"])->setContext(AccompanyingPeriodContext::class) ->setDescription("description")->setActive(true) ->setOptions($options); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php index 71fce8c92..fa99a5363 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php @@ -102,7 +102,7 @@ final class PersonContextTest extends KernelTestCase self::$container->get(ThirdPartyRepository::class) ); $template = new DocGeneratorTemplate(); - $template->setName(["fr" =>"test"])->setContext(AccompanyingPeriodContext::class) + $template->setName(["fr" => "test"])->setContext(AccompanyingPeriodContext::class) ->setDescription("description")->setActive(true) ->setOptions($options); From 68f2c7df25e429e96c5bb40132f3b21a724bf703 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 24 Aug 2023 14:32:50 +0200 Subject: [PATCH 54/91] Fixed: [vuejs] fix missing translation in HouseholdMembersEditor component --- .../vuejs/HouseholdMembersEditor/components/PersonComment.vue | 2 +- .../Resources/public/vuejs/HouseholdMembersEditor/js/i18n.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/PersonComment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/PersonComment.vue index cb9a02d51..8f61a74d1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/PersonComment.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/PersonComment.vue @@ -1,7 +1,7 @@