From 63ed046c9aef27ba53b3042e2146133cafcb59e3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 25 Nov 2024 17:44:59 +0100 Subject: [PATCH 01/16] Normalize genderEntity for document generation --- src/Bundle/ChillMainBundle/Entity/Gender.php | 6 +-- .../Normalizer/GenderDocGenNormalizer.php | 39 +++++++++++++++++++ .../Normalizer/PersonDocGenNormalizer.php | 3 +- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php diff --git a/src/Bundle/ChillMainBundle/Entity/Gender.php b/src/Bundle/ChillMainBundle/Entity/Gender.php index 59c0bd134..d1baad400 100644 --- a/src/Bundle/ChillMainBundle/Entity/Gender.php +++ b/src/Bundle/ChillMainBundle/Entity/Gender.php @@ -21,13 +21,13 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\Table(name: 'chill_main_gender')] class Gender { - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] private array $label = []; @@ -36,7 +36,7 @@ class Gender private bool $active = true; #[Assert\NotNull(message: 'You must choose a gender translation')] - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderEnum::class)] private GenderEnum $genderTranslation; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php new file mode 100644 index 000000000..5af99be5a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php @@ -0,0 +1,39 @@ + $gender->getId(), + 'label' => $this->translatableStringHelper->localize($gender->getLabel()), + 'genderTranslation' => $gender->getGenderTranslation(), + ]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 582127704..784e0ab02 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -95,7 +95,8 @@ class PersonDocGenNormalizer implements 'age' => (int) $person->getAge(), 'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $dateContext), 'deathdate' => $this->normalizer->normalize($person->getDeathdate(), $format, $dateContext), - 'gender' => $this->normalizer->normalize($person->getGender(), $format, $genderContext), + 'gender' => $this->translatableStringHelper->localize($person->getGender()->getLabel()), + 'genderEntity' => $this->normalizer->normalize($person->getGender(), $format, $genderContext), 'maritalStatus' => null !== ($ms = $person->getMaritalStatus()) ? $this->translatableStringHelper->localize($ms->getName()) : '', 'maritalStatusDate' => $this->normalizer->normalize($person->getMaritalStatusDate(), $format, $dateContext), 'maritalStatusComment' => $this->normalizer->normalize($person->getMaritalStatusComment(), $format, $dateContext), From 0b22250dd528ca12d03af539ad860d7e2201dcab Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 25 Nov 2024 17:44:59 +0100 Subject: [PATCH 02/16] Normalize genderEntity for document generation --- src/Bundle/ChillMainBundle/Entity/Gender.php | 6 +-- .../Normalizer/GenderDocGenNormalizer.php | 39 +++++++++++++++++++ .../Normalizer/PersonDocGenNormalizer.php | 3 +- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php diff --git a/src/Bundle/ChillMainBundle/Entity/Gender.php b/src/Bundle/ChillMainBundle/Entity/Gender.php index 59c0bd134..d1baad400 100644 --- a/src/Bundle/ChillMainBundle/Entity/Gender.php +++ b/src/Bundle/ChillMainBundle/Entity/Gender.php @@ -21,13 +21,13 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\Table(name: 'chill_main_gender')] class Gender { - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] private array $label = []; @@ -36,7 +36,7 @@ class Gender private bool $active = true; #[Assert\NotNull(message: 'You must choose a gender translation')] - #[Serializer\Groups(['read'])] + #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderEnum::class)] private GenderEnum $genderTranslation; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php new file mode 100644 index 000000000..5af99be5a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php @@ -0,0 +1,39 @@ + $gender->getId(), + 'label' => $this->translatableStringHelper->localize($gender->getLabel()), + 'genderTranslation' => $gender->getGenderTranslation(), + ]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 582127704..784e0ab02 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -95,7 +95,8 @@ class PersonDocGenNormalizer implements 'age' => (int) $person->getAge(), 'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $dateContext), 'deathdate' => $this->normalizer->normalize($person->getDeathdate(), $format, $dateContext), - 'gender' => $this->normalizer->normalize($person->getGender(), $format, $genderContext), + 'gender' => $this->translatableStringHelper->localize($person->getGender()->getLabel()), + 'genderEntity' => $this->normalizer->normalize($person->getGender(), $format, $genderContext), 'maritalStatus' => null !== ($ms = $person->getMaritalStatus()) ? $this->translatableStringHelper->localize($ms->getName()) : '', 'maritalStatusDate' => $this->normalizer->normalize($person->getMaritalStatusDate(), $format, $dateContext), 'maritalStatusComment' => $this->normalizer->normalize($person->getMaritalStatusComment(), $format, $dateContext), From f4f5153ed0cd4d576cb03c6ec5332b01f553a77d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 26 Nov 2024 15:37:05 +0100 Subject: [PATCH 03/16] Take null value for gender into account and user Interface for translatableStringHelper --- .../Serializer/Normalizer/GenderDocGenNormalizer.php | 4 ++-- .../Serializer/Normalizer/PersonDocGenNormalizer.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php index 5af99be5a..3e9366673 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Serializer\Normalizer; use Chill\MainBundle\Entity\Gender; -use Chill\MainBundle\Templating\TranslatableStringHelper; +use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; @@ -21,7 +21,7 @@ class GenderDocGenNormalizer implements ContextAwareNormalizerInterface, Normali { use NormalizerAwareTrait; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} public function supportsNormalization($data, ?string $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 784e0ab02..0f042691d 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -95,7 +95,7 @@ class PersonDocGenNormalizer implements 'age' => (int) $person->getAge(), 'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $dateContext), 'deathdate' => $this->normalizer->normalize($person->getDeathdate(), $format, $dateContext), - 'gender' => $this->translatableStringHelper->localize($person->getGender()->getLabel()), + 'gender' => null !== ($g = $person->getGender()) ? $this->translatableStringHelper->localize($g->getLabel()) : '', 'genderEntity' => $this->normalizer->normalize($person->getGender(), $format, $genderContext), 'maritalStatus' => null !== ($ms = $person->getMaritalStatus()) ? $this->translatableStringHelper->localize($ms->getName()) : '', 'maritalStatusDate' => $this->normalizer->normalize($person->getMaritalStatusDate(), $format, $dateContext), From 5afb92d5492169721a618c0dc6b387cf1d5d4eb3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 26 Nov 2024 18:04:12 +0100 Subject: [PATCH 04/16] add unit test for GenderDocGenNormalizer and move file to MainBundle --- src/Bundle/ChillMainBundle/Entity/Gender.php | 6 +- .../Normalizer/GenderDocGenNormalizer.php | 2 +- .../Normalizer/GenderDocGenNormalizerTest.php | 69 +++++++++++++++++++ 3 files changed, 73 insertions(+), 4 deletions(-) rename src/Bundle/{ChillPersonBundle => ChillMainBundle}/Serializer/Normalizer/GenderDocGenNormalizer.php (95%) create mode 100644 src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php diff --git a/src/Bundle/ChillMainBundle/Entity/Gender.php b/src/Bundle/ChillMainBundle/Entity/Gender.php index d1baad400..59c0bd134 100644 --- a/src/Bundle/ChillMainBundle/Entity/Gender.php +++ b/src/Bundle/ChillMainBundle/Entity/Gender.php @@ -21,13 +21,13 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\Table(name: 'chill_main_gender')] class Gender { - #[Serializer\Groups(['read', 'docgen:read'])] + #[Serializer\Groups(['read'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; - #[Serializer\Groups(['read', 'docgen:read'])] + #[Serializer\Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] private array $label = []; @@ -36,7 +36,7 @@ class Gender private bool $active = true; #[Assert\NotNull(message: 'You must choose a gender translation')] - #[Serializer\Groups(['read', 'docgen:read'])] + #[Serializer\Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderEnum::class)] private GenderEnum $genderTranslation; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/GenderDocGenNormalizer.php similarity index 95% rename from src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php rename to src/Bundle/ChillMainBundle/Serializer/Normalizer/GenderDocGenNormalizer.php index 3e9366673..f7dd84dfc 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/GenderDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/GenderDocGenNormalizer.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\PersonBundle\Serializer\Normalizer; +namespace Chill\MainBundle\Serializer\Normalizer; use Chill\MainBundle\Entity\Gender; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php new file mode 100644 index 000000000..df72fd39c --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php @@ -0,0 +1,69 @@ +translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); + $this->normalizer = new GenderDocGenNormalizer($this->translatableStringHelper); + } + + public function testSupportsNormalizationReturnsTrueForGenderInstance(): void + { + $gender = $this->createMock(Gender::class); + $this->assertTrue($this->normalizer->supportsNormalization($gender)); + } + + public function testSupportsNormalizationReturnsFalseForNonGenderInstance(): void + { + $this->assertFalse($this->normalizer->supportsNormalization(new \stdClass())); + } + + public function testNormalizeReturnsCorrectData(): void + { + $gender = $this->createMock(Gender::class); + + $gender->method('getId')->willReturn(1); + $gender->method('getLabel')->willReturn(['fr' => 'homme', 'en' => 'man']); + $gender->method('getGenderTranslation')->willReturn(GenderEnum::MALE); + + $this->translatableStringHelper + ->method('localize') + ->with(['fr' => 'homme', 'en' => 'man']) + ->willReturn('homme'); + + $expected = [ + 'id' => 1, + 'label' => 'homme', + 'genderTranslation' => GenderEnum::MALE, + ]; + + $this->assertEquals($expected, $this->normalizer->normalize($gender)); + } +} + From 3e355a6465007ecb529ba93e1570a556affbcd15 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 26 Nov 2024 18:04:36 +0100 Subject: [PATCH 05/16] php cs fixer --- .../ChillActivityBundle/Entity/Activity.php | 4 ++-- .../ChillCalendarBundle/Entity/Calendar.php | 4 ++-- .../Context/ContextManager.php | 2 +- .../Entity/StoredObject.php | 2 +- src/Bundle/ChillJobBundle/src/Entity/CV.php | 4 ++-- .../src/Entity/ProjetProfessionnel.php | 4 ++-- .../ChillJobBundle/src/Entity/Rome/Metier.php | 2 +- src/Bundle/ChillMainBundle/Entity/User.php | 6 ++--- .../Entity/Workflow/EntityWorkflow.php | 2 +- .../Entity/Workflow/EntityWorkflowStep.php | 2 +- .../Repository/UserRepository.php | 2 +- .../Repository/UserRepositoryInterface.php | 2 +- .../Resolver/CenterResolverDispatcher.php | 2 +- .../Resolver/CenterResolverManager.php | 2 +- .../Resolver/ScopeResolverDispatcher.php | 2 +- .../Workflow/EntityWorkflowManager.php | 2 +- .../Entity/AccompanyingPeriod.php | 4 ++-- .../AccompanyingPeriodWork.php | 2 +- .../Entity/Household/Household.php | 4 ++-- .../ChillPersonBundle/Entity/Person.php | 22 +++++++++---------- .../Entity/SocialWork/Evaluation.php | 2 +- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 9f557f9b5..4701d2483 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -107,7 +107,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private ?Person $person = null; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: Person::class)] @@ -132,7 +132,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private string $sentReceived = ''; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: SocialAction::class)] diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 05d75a9bc..dad302193 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -103,7 +103,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private int $dateTimeVersion = 0; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: CalendarDoc::class, orphanRemoval: true)] private Collection $documents; @@ -120,7 +120,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private ?int $id = null; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: Invite::class, cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)] diff --git a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php index afcf6fab1..4aa6b042a 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php +++ b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php @@ -17,7 +17,7 @@ use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; final readonly class ContextManager implements ContextManagerInterface { /** - * @param \Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface[] $contexts + * @param DocGeneratorContextInterface[] $contexts */ public function __construct(private iterable $contexts) {} diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index 06c2e5bd3..d13452f76 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -272,7 +272,7 @@ class StoredObject implements Document, TrackCreationInterface * * @param 'ASC'|'DESC' $order the sorting order, default is Order::Ascending * - * @return readableCollection&Selectable The ordered collection of versions + * @return ReadableCollection&Selectable The ordered collection of versions */ public function getVersionsOrdered(string $order = 'ASC'): ReadableCollection&Selectable { diff --git a/src/Bundle/ChillJobBundle/src/Entity/CV.php b/src/Bundle/ChillJobBundle/src/Entity/CV.php index 257e4a0d0..12a57baca 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/CV.php +++ b/src/Bundle/ChillJobBundle/src/Entity/CV.php @@ -73,7 +73,7 @@ class CV implements \Stringable /** * @Assert\Valid(traverse=true) * - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: CV\Formation::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)] // #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] @@ -82,7 +82,7 @@ class CV implements \Stringable /** * @Assert\Valid(traverse=true) * - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: CV\Experience::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)] // #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] diff --git a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php index 58a1fca41..6c808307e 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php @@ -45,7 +45,7 @@ class ProjetProfessionnel implements \Stringable private ?\DateTimeInterface $reportDate = null; /** - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\JoinTable(name: 'chill_job.projetprofessionnel_souhait')] #[ORM\ManyToMany(targetEntity: Appellation::class, cascade: ['persist'])] @@ -94,7 +94,7 @@ class ProjetProfessionnel implements \Stringable private ?string $enCoursConstruction = null; /** - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\JoinTable(name: 'chill_job.projetprofessionnel_valide')] #[ORM\ManyToMany(targetEntity: Appellation::class)] diff --git a/src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php b/src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php index ce44a6acf..2df9ff3aa 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php @@ -33,7 +33,7 @@ class Metier private ?string $code = ''; /** - * @var \Doctrine\Common\Collections\Collection + * @var \Doctrine\Common\Collections\Collection */ #[ORM\OneToMany(targetEntity: Appellation::class, mappedBy: 'metier')] private \Doctrine\Common\Collections\Collection $appellations; diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 0c8c87553..448efbdd1 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -64,7 +64,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter private bool $enabled = true; /** - * @var Collection + * @var Collection */ #[ORM\ManyToMany(targetEntity: GroupCenter::class, inversedBy: 'users')] #[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] @@ -83,7 +83,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter private ?Location $mainLocation = null; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[ORM\OneToMany(mappedBy: 'user', targetEntity: UserScopeHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)] private Collection&Selectable $scopeHistories; @@ -98,7 +98,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter private ?string $salt = null; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[ORM\OneToMany(mappedBy: 'user', targetEntity: UserJobHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)] private Collection&Selectable $jobHistories; diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php index d5a51af16..1c4413294 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php @@ -36,7 +36,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface use TrackUpdateTrait; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(mappedBy: 'entityWorkflow', targetEntity: EntityWorkflowComment::class, orphanRemoval: true)] private Collection $comments; diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php index 40a7bc1a2..f9556c33a 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php @@ -107,7 +107,7 @@ class EntityWorkflowStep private ?string $transitionByEmail = null; /** - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\OneToMany(mappedBy: 'step', targetEntity: EntityWorkflowStepHold::class)] private Collection $holdsOnStep; diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepository.php b/src/Bundle/ChillMainBundle/Repository/UserRepository.php index 3ee0828a7..9ac8af9ee 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepository.php @@ -261,7 +261,7 @@ final readonly class UserRepository implements UserRepositoryInterface * allows to make a first search amongst users based on role and center * and, then filter those users having some flags. * - * @param \Chill\MainBundle\Entity\User[] $amongstUsers + * @param User[] $amongstUsers */ public function findUsersHavingFlags($flag, array $amongstUsers = []): array { diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php index b7a20f315..f6c74b7dd 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php @@ -71,7 +71,7 @@ interface UserRepositoryInterface extends ObjectRepository * allows to make a first search amongst users based on role and center * and, then filter those users having some flags. * - * @param \Chill\MainBundle\Entity\User[] $amongstUsers + * @param User[] $amongstUsers */ public function findUsersHavingFlags(mixed $flag, array $amongstUsers = []): array; } diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php index 903b8c5c5..fcf774505 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php @@ -14,7 +14,7 @@ namespace Chill\MainBundle\Security\Resolver; final readonly class CenterResolverDispatcher implements CenterResolverDispatcherInterface { /** - * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers + * @param CenterResolverInterface[] $resolvers */ public function __construct(private iterable $resolvers = []) {} diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php index 813ab1526..b75e1c634 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php @@ -16,7 +16,7 @@ use Chill\MainBundle\Entity\Center; final readonly class CenterResolverManager implements CenterResolverManagerInterface { /** - * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers + * @param CenterResolverInterface[] $resolvers */ public function __construct(private iterable $resolvers = []) { diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index 387bc724e..50cca33d5 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -17,7 +17,7 @@ use Doctrine\Common\Collections\Collection; final readonly class ScopeResolverDispatcher { /** - * @param \Chill\MainBundle\Security\Resolver\ScopeResolverInterface[] $resolvers + * @param ScopeResolverInterface[] $resolvers */ public function __construct(private iterable $resolvers) {} diff --git a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php index bfe41f559..50719f4ae 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php +++ b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php @@ -30,7 +30,7 @@ use Symfony\Component\Workflow\Registry; class EntityWorkflowManager { /** - * @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers + * @param EntityWorkflowHandlerInterface[] $handlers */ public function __construct(private readonly iterable $handlers, private readonly Registry $registry) {} diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 85b80faf8..91c8714bb 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -135,7 +135,7 @@ class AccompanyingPeriod implements private ?Location $administrativeLocation = null; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: Calendar::class)] private Collection&Selectable $calendars; @@ -153,7 +153,7 @@ class AccompanyingPeriod implements private ?ClosingMotive $closingMotive = null; /** - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_DRAFT])] #[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: Comment::class, cascade: ['persist', 'remove'], orphanRemoval: true)] diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index af012c5ff..9152c96be 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -112,7 +112,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues private Collection $referrersHistory; /** - * @var Collection + * @var Collection */ #[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])] #[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'accompanyingPeriodWorks')] diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index 6ecc0366d..dc67f6b93 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -36,7 +36,7 @@ class Household implements HasCentersInterface /** * Addresses. * - * @var Collection + * @var Collection */ #[Serializer\Groups(['write'])] #[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])] @@ -48,7 +48,7 @@ class Household implements HasCentersInterface private CommentEmbeddable $commentMembers; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[Assert\Valid(groups: ['household_composition'], traverse: true)] #[ORM\OneToMany(mappedBy: 'household', targetEntity: HouseholdComposition::class, cascade: ['persist'], orphanRemoval: true)] diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 4a0664652..74b4a2ef5 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -83,7 +83,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * The person's accompanying periods (when the person was accompanied by the center). * - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'])] #[ORM\OrderBy(['startDate' => Criteria::DESC])] @@ -92,7 +92,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * The accompanying period requested by the Person. * - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'requestorPerson')] private Collection $accompanyingPeriodRequested; @@ -100,7 +100,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * Addresses. * - * @var Collection + * @var Collection */ #[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])] #[ORM\JoinTable(name: 'chill_person_persons_to_addresses')] @@ -108,7 +108,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI private Collection $addresses; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)] private Collection $altNames; @@ -121,7 +121,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI private ?\DateTime $birthdate = null; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: Charge::class, mappedBy: 'person')] private Collection $budgetCharges; @@ -150,7 +150,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI private ?PersonCenterCurrent $centerCurrent = null; /** - * @var \Doctrine\Common\Collections\Collection&Selectable + * @var Collection&Selectable */ #[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonCenterHistory::class, cascade: ['persist', 'remove'])] private Collection&Selectable $centerHistory; @@ -252,13 +252,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * Read-only field, computed by the database. * - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: PersonHouseholdAddress::class, mappedBy: 'person')] private Collection $householdAddresses; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: HouseholdMember::class, mappedBy: 'person')] private Collection $householdParticipations; @@ -325,14 +325,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI private ?int $numberOfChildren = null; /** - * @var Collection + * @var Collection */ #[Assert\Valid(traverse: true)] #[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)] private Collection $otherPhoneNumbers; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'personLocation')] private Collection $periodLocatedOn; @@ -356,7 +356,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $proxyAccompanyingPeriodOpenState = false; // TO-DELETE ? /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(targetEntity: PersonResource::class, mappedBy: 'personOwner')] private Collection $resources; diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php index 8a1fc1c9b..757dd9354 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -39,7 +39,7 @@ class Evaluation private ?\DateInterval $notificationDelay = null; /** - * @var \Doctrine\Common\Collections\Collection + * @var Collection */ #[ORM\ManyToMany(targetEntity: SocialAction::class, mappedBy: 'evaluations')] private Collection $socialActions; From 401db94d6cf49d2b204ac6c1782b1a3b88944aa0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 26 Nov 2024 18:09:40 +0100 Subject: [PATCH 06/16] php cs fixer of GenderDocGenNormalizerTest --- .../Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php index df72fd39c..7f0762ad8 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/GenderDocGenNormalizerTest.php @@ -66,4 +66,3 @@ final class GenderDocGenNormalizerTest extends TestCase $this->assertEquals($expected, $this->normalizer->normalize($gender)); } } - From 5866496f49fabb77bd2606fdab80c71f1d8af7db Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 27 Nov 2024 20:23:57 +0100 Subject: [PATCH 07/16] Add genderEntity key to peronDocGenNormalizerTest --- .../Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 797ca2595..83f82d212 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -50,6 +50,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase 'birthdate' => ['short' => '', 'long' => ''], 'deathdate' => ['short' => '', 'long' => ''], 'gender' => '', + 'genderEntity' => '', 'civility' => '@ignored', 'address' => '@ignored', 'maritalStatus' => '', From 8a16030b4992180a2544a2fe7e8a6b76c14d4d5f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 11:31:22 +0100 Subject: [PATCH 08/16] Add genderEntity to normalizeNullValue of PersonDocGenNormalizer --- .../Serializer/Normalizer/PersonDocGenNormalizer.php | 1 + .../Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 0f042691d..29c22280c 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -216,6 +216,7 @@ class PersonDocGenNormalizer implements 'civility' => Civility::class, 'birthdate' => \DateTimeInterface::class, 'deathdate' => \DateTimeInterface::class, + 'genderEntity' => Gender::class, 'gender', 'maritalStatus', 'maritalStatusDate' => \DateTimeInterface::class, 'maritalStatusComment', diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 83f82d212..fb2e54fe9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -40,7 +40,6 @@ final class PersonDocGenNormalizerTest extends KernelTestCase private const BLANK = [ 'id' => '', - 'center' => '', 'firstName' => '', 'lastName' => '', 'altNames' => '', From d68de960049da5a82eb6df986014efef138e844a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 11:47:17 +0100 Subject: [PATCH 09/16] [phpstan fix] Add void return type on all fixture load methods --- .../DataFixtures/ORM/LoadActivity.php | 12 ++++++------ .../DataFixtures/ORM/LoadActivityReason.php | 2 +- .../DataFixtures/ORM/LoadActivityReasonCategory.php | 2 +- .../DataFixtures/ORM/LoadActivityType.php | 2 +- .../DataFixtures/ORM/LoadActivityTypeCategory.php | 2 +- .../DataFixtures/ORM/LoadActivitytACL.php | 2 +- .../src/DataFixtures/ORM/LoadAsideActivity.php | 2 +- .../DataFixtures/ORM/LoadAsideActivityCategory.php | 2 +- .../DataFixtures/ORM/LoadOption.php | 2 +- .../DataFixtures/ORM/LoadDocGeneratorTemplate.php | 2 +- .../DataFixtures/ORM/LoadDocumentACL.php | 2 +- .../DataFixtures/ORM/LoadDocumentCategory.php | 2 +- .../DataFixtures/ORM/LoadEventTypes.php | 2 +- .../DataFixtures/ORM/LoadParticipation.php | 2 +- .../DataFixtures/ORM/LoadRolesACL.php | 2 +- .../ORM/LoadAbstractNotificationsTrait.php | 2 +- .../DataFixtures/ORM/LoadAddressReferences.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadCenters.php | 2 +- .../DataFixtures/ORM/LoadCountries.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadGenders.php | 2 +- .../DataFixtures/ORM/LoadGroupCenters.php | 2 +- .../DataFixtures/ORM/LoadLanguages.php | 2 +- .../DataFixtures/ORM/LoadPermissionsGroup.php | 2 +- .../DataFixtures/ORM/LoadPostalCodes.php | 2 +- .../DataFixtures/ORM/LoadRoleScopes.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadScopes.php | 2 +- .../DataFixtures/ORM/LoadUserGroup.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadUsers.php | 2 +- .../ORM/LoadAccompanyingPeriodClosingMotive.php | 2 +- .../ORM/LoadAccompanyingPeriodOrigin.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodWork.php | 2 +- .../DataFixtures/ORM/LoadCustomFields.php | 2 +- .../DataFixtures/ORM/LoadHousehold.php | 2 +- .../ORM/LoadHouseholdCompositionType.php | 2 +- .../DataFixtures/ORM/LoadHouseholdPosition.php | 2 +- .../DataFixtures/ORM/LoadMaritalStatus.php | 2 +- .../DataFixtures/ORM/LoadPeople.php | 2 +- .../DataFixtures/ORM/LoadPersonACL.php | 2 +- .../DataFixtures/ORM/LoadRelations.php | 2 +- .../DataFixtures/ORM/LoadSocialWorkMetadata.php | 2 +- .../DataFixtures/ORM/LoadCustomField.php | 2 +- .../DataFixtures/ORM/LoadCustomFieldsGroup.php | 2 +- .../DataFixtures/ORM/LoadReportACL.php | 2 +- .../DataFixtures/ORM/LoadReports.php | 2 +- .../ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php | 2 +- .../DataFixtures/ORM/LoadThirdParty.php | 2 +- .../DataFixtures/ORM/LoadThirdPartyCategory.php | 2 +- .../DataFixtures/ORM/LoadThirdPartyProfession.php | 2 +- 48 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index a547ab21e..3a85d46ce 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -32,12 +32,12 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface $this->faker = FakerFactory::create('fr_FR'); } - public function getOrder() + public function getOrder(): int { return 16400; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $persons = $this->em ->getRepository(Person::class) @@ -87,7 +87,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface * * @return \Chill\ActivityBundle\Entity\ActivityReason */ - private function getRandomActivityReason() + private function getRandomActivityReason(): \Chill\ActivityBundle\Entity\ActivityReason { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; @@ -99,7 +99,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface * * @return \Chill\ActivityBundle\Entity\ActivityType */ - private function getRandomActivityType() + private function getRandomActivityType(): \Chill\ActivityBundle\Entity\ActivityType { $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; @@ -111,7 +111,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface * * @return \Chill\MainBundle\Entity\Scope */ - private function getRandomScope() + private function getRandomScope(): \Chill\MainBundle\Entity\Scope { $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; @@ -123,7 +123,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface * * @return \Chill\MainBundle\Entity\User */ - private function getRandomUser() + private function getRandomUser(): \Chill\MainBundle\Entity\User { $userRef = array_rand(LoadUsers::$refs); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index af674be9e..5e4e47d35 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -28,7 +28,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf return 16300; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $reasons = [ [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php index a78ae3972..3ba97be36 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php @@ -26,7 +26,7 @@ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtu return 16200; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $categs = [ ['name' => ['fr' => 'Logement', 'en' => 'Housing', 'nl' => 'Woning']], diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 891f2c979..b156d7a0f 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -28,7 +28,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface return 16100; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $types = [ // Exange diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php index 2f15a2676..9d160306d 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php @@ -28,7 +28,7 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac return 16050; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $categories = [ [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index e7c893cd9..534cbdd8b 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -31,7 +31,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac return 16000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index 12c82be00..75cac30a1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -30,7 +30,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface ]; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $user = $this->userRepository->findOneBy(['username' => 'center a_social']); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php index 3e6b4247a..73f764ca5 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php @@ -16,7 +16,7 @@ use Doctrine\Persistence\ObjectManager; class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture { - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach ( [ diff --git a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php index f95991b7c..5baf43508 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php +++ b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php @@ -51,7 +51,7 @@ class LoadOption extends AbstractFixture implements OrderedFixtureInterface return 1000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "Loading Options \n"; diff --git a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php index f38102a10..a136dec58 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php +++ b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php @@ -23,7 +23,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadDocGeneratorTemplate extends AbstractFixture { - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $templates = [ [ diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index 1217c2a12..b18255883 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -29,7 +29,7 @@ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface return 35000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php index 92c3780fe..4b6dacd8e 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php @@ -23,7 +23,7 @@ class LoadDocumentCategory extends AbstractFixture implements OrderedFixtureInte return 35010; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $category = (new DocumentCategory('chill-doc-store', 10)) ->setDocumentClass(\Chill\DocStoreBundle\Entity\PersonDocument::class) diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php index 1d2668c12..f3e901c88 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php @@ -30,7 +30,7 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface return 30000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { /* * Echange de savoirs diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index db431c858..edd937523 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -63,7 +63,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa return 30010; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $centers = $manager->getRepository(Center::class) ->findAll(); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 87e676730..272aa03cb 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -28,7 +28,7 @@ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface return 30011; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php index fdecd4092..0e9eb3f84 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php @@ -19,7 +19,7 @@ use Doctrine\Persistence\ObjectManager; */ trait LoadAbstractNotificationsTrait { - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { return; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index d04ef29e8..ccb8c49ae 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -38,7 +38,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt return 51; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading some reference address... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php index d835aad38..c91e5086e 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php @@ -36,7 +36,7 @@ class LoadCenters extends AbstractFixture implements OrderedFixtureInterface return 100; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (static::$centers as $new) { $center = new Center(); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php index 3433eebd7..5a306035e 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php @@ -30,7 +30,7 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, return 20; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading countries... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php index 2d74e6977..87505acde 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php @@ -43,7 +43,7 @@ class LoadGenders extends AbstractFixture implements OrderedFixtureInterface return 100; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading genders... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index 8254dec1d..8f19f14bd 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -25,7 +25,7 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac return 500; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadCenters::$refs as $centerRef) { foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php index c5c03277f..484d1bfdf 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php @@ -38,7 +38,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, return 10; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading languages... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 885fc9af6..c1c449c35 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -52,7 +52,7 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte return 400; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (static::$permissionGroup as $new) { $permissionGroup = new PermissionsGroup(); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 29ee21ca6..4207e87ff 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -330,7 +330,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface return 50; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading postal codes... \n"; $this->loadPostalCodeCSV($manager, self::$postalCodeBelgium, 'BE'); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index 85e3f4ec2..d427bc58c 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -49,7 +49,7 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface return 300; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (static::$permissions as $key => $permission) { foreach (LoadScopes::$references as $scopeReference) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php index 10c10de8c..3ec23c03e 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php @@ -51,7 +51,7 @@ class LoadScopes extends AbstractFixture implements OrderedFixtureInterface return 200; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach ($this->scopes as $new) { $scope = new \Chill\MainBundle\Entity\Scope(); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserGroup.php index 614a83515..430efaf56 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserGroup.php @@ -24,7 +24,7 @@ class LoadUserGroup extends Fixture implements FixtureGroupInterface return ['user-group']; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $centerASocial = $manager->getRepository(User::class)->findOneBy(['username' => 'center a_social']); $centerBSocial = $manager->getRepository(User::class)->findOneBy(['username' => 'center b_social']); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 1c99a3a74..0346890b1 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -59,7 +59,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde return 1000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (self::$refs as $username => $params) { $user = new User(); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php index fb836ed3a..efbde0a10 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php @@ -53,7 +53,7 @@ class LoadAccompanyingPeriodClosingMotive extends AbstractFixture implements Ord return 9500; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (static::$closingMotives as $ref => $new) { $motive = new ClosingMotive(); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php index 8eb0688bd..ffb2d096b 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php @@ -32,7 +32,7 @@ class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFix return 9000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $o = new Origin(); $o->setLabel($this->phoneCall); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 44992ebef..bf75ddec9 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -35,7 +35,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ]; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { // load all the period which are confirmed $periods = $this->periodRepository diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 2acbcbfbd..68a2a34a5 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -45,7 +45,7 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac return 10003; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $this->loadFields($manager); $this->loadData($manager); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index ba2c67a08..b8963f84c 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -46,7 +46,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface ]; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { // generate two times the participation. This will lead to // some movement in participation (same people in two differents diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php index c985f26d3..9b81b9cb8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php @@ -34,7 +34,7 @@ class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGro return ['composition-type']; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (self::TYPES as $type) { $manager->persist( diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php index f5c28c8c2..fa3e36900 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php @@ -29,7 +29,7 @@ class LoadHouseholdPosition extends Fixture ['Enfant hors ménage', false, false, 3.0, self::CHILD_OUT], ]; - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach ( self::POSITIONS_DATA as [$name, $share, $allowHolder, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php index ddce77d6c..946e858d8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php @@ -36,7 +36,7 @@ class LoadMaritalStatus extends AbstractFixture implements OrderedFixtureInterfa return 9999; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading maritalStatuses... \n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index f1be52959..ebc24b881 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -310,7 +310,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord return $this->cacheMaritalStatuses[array_rand($this->cacheMaritalStatuses)]; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $this->loadExpectedPeople($manager); $this->loadRandPeople($manager); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index 4b57dd048..136077799 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -30,7 +30,7 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface return 9600; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php index 529918377..b987d1ebc 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php @@ -35,7 +35,7 @@ class LoadRelations extends Fixture implements FixtureGroupInterface return ['person_relations']; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (self::RELATIONS as $key => $value) { echo 'Creating a new relation type: relation'.$value['title']['fr'].'reverse relation: '.$value['reverseTitle']['fr']."\n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php index dc1e7b4dd..b5c752639 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php @@ -26,7 +26,7 @@ class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface return 9500; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { try { $csv = Reader::createFromPath(__DIR__.'/data/social_work_metadata.csv'); diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index e32b73544..e8be9fb71 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -26,7 +26,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface return 15001; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $cFTypes = [ ['type' => 'text', 'options' => ['maxLength' => '255']], diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php index 6e4639210..2f86dbae3 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php @@ -26,7 +26,7 @@ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInt return 15000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading customFieldsGroup...\n"; diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index 2aa175b80..eee7dc3e7 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -29,7 +29,7 @@ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface return 14999; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 222458a25..1b2928f5c 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -40,7 +40,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa return 15002; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $this->createExpected($manager); diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index cb38df91c..1396376c9 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -30,7 +30,7 @@ class LoadTaskACL extends AbstractFixture implements OrderedFixtureInterface return 16000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 7261deba4..043b002fd 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -40,7 +40,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface ]; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $thirdParties = $this->getThirdParties()->getObjects(); diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php index 061c85a4a..e90ccd130 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php @@ -26,7 +26,7 @@ class LoadThirdPartyCategory extends Fixture implements FixtureGroupInterface return ['thirdparty_categories']; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $categories = [ ['name' => ['fr' => 'maison médicale']], diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php index 265a773cb..0442f05ef 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php @@ -26,7 +26,7 @@ class LoadThirdPartyProfession extends Fixture implements FixtureGroupInterface return ['thirdparty_professions']; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $professions = [ ['name' => ['fr' => 'Directeur']], From 11ba2cf889a2363764de388268dbb304cadab4e3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 12:02:48 +0100 Subject: [PATCH 10/16] [phpstan fix] Add array return type on all dependency fixture getDependencies methods --- .../DataFixtures/ORM/LoadActivityNotifications.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodWork.php | 2 +- src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php | 2 +- .../ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php index ee999d7f1..2718ce9e1 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php @@ -38,7 +38,7 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt ], ]; - public function getDependencies() + public function getDependencies(): array { return [ LoadActivity::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php index e298c2cc3..ee5a6f6f9 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php @@ -38,7 +38,7 @@ class LoadAccompanyingPeriodNotifications extends AbstractFixture implements Dep ], ]; - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index bf75ddec9..e24cca688 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -28,7 +28,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) {} - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index b8963f84c..cf9a2b1e0 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -38,7 +38,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface $this->loader = new NativeLoader(); } - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 043b002fd..8eb5dd48c 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -32,7 +32,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); } - public function getDependencies() + public function getDependencies(): array { return [ LoadCenters::class, From fa767110e8b5cffae82412842f5d556ad2365dca Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 12:20:17 +0100 Subject: [PATCH 11/16] Add int return type to getOrder() method in fixture classes --- .../ChillActivityBundle/DataFixtures/ORM/LoadActivity.php | 4 ++-- .../DataFixtures/ORM/LoadActivityNotifications.php | 2 +- .../DataFixtures/ORM/LoadActivityReason.php | 2 +- .../DataFixtures/ORM/LoadActivityReasonCategory.php | 2 +- .../ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php | 2 +- .../DataFixtures/ORM/LoadActivityTypeCategory.php | 2 +- .../ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php | 2 +- .../ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php | 2 +- .../ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php | 2 +- .../DataFixtures/ORM/LoadDocumentCategory.php | 2 +- .../ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php | 2 +- .../ChillEventBundle/DataFixtures/ORM/LoadParticipation.php | 2 +- src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php | 2 +- src/Bundle/ChillEventBundle/Search/EventSearch.php | 2 +- .../DataFixtures/ORM/LoadAddressReferences.php | 2 +- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php | 2 +- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php | 4 ++-- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php | 2 +- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadLocationType.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php | 2 +- .../ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php | 2 +- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php | 2 +- src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php | 2 +- src/Bundle/ChillMainBundle/Search/SearchInterface.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodWork.php | 2 +- .../ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php | 2 +- .../ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php | 2 +- .../ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php | 2 +- src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php | 2 +- .../ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php | 2 +- .../DataFixtures/ORM/LoadSocialWorkMetadata.php | 2 +- src/Bundle/ChillPersonBundle/Search/PersonSearch.php | 2 +- .../ChillReportBundle/DataFixtures/ORM/LoadCustomField.php | 2 +- .../DataFixtures/ORM/LoadCustomFieldsGroup.php | 2 +- .../ChillReportBundle/DataFixtures/ORM/LoadReportACL.php | 2 +- src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php | 2 +- src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php | 4 ++-- .../ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php | 2 +- 44 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index a547ab21e..7430cf1ef 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -32,12 +32,12 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface $this->faker = FakerFactory::create('fr_FR'); } - public function getOrder() + public function getOrder(): int { return 16400; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { $persons = $this->em ->getRepository(Person::class) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php index ee999d7f1..2718ce9e1 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php @@ -38,7 +38,7 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt ], ]; - public function getDependencies() + public function getDependencies(): array { return [ LoadActivity::class, diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index af674be9e..5682b0ad5 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -23,7 +23,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf { public static $references = []; - public function getOrder() + public function getOrder(): int { return 16300; } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php index a78ae3972..e90ab7d0f 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 16200; } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 891f2c979..8aa80d694 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -23,7 +23,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface { public static $references = []; - public function getOrder() + public function getOrder(): int { return 16100; } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php index 2f15a2676..00eb94517 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php @@ -23,7 +23,7 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac { public static $references = []; - public function getOrder() + public function getOrder(): int { return 16050; } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index e7c893cd9..92ad6ab3e 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -26,7 +26,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 16000; } diff --git a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php index f95991b7c..49edb7b77 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php +++ b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php @@ -46,7 +46,7 @@ class LoadOption extends AbstractFixture implements OrderedFixtureInterface $this->fakerNl = \Faker\Factory::create('nl_NL'); } - public function getOrder() + public function getOrder(): int { return 1000; } diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index 1217c2a12..f227955a8 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -24,7 +24,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 35000; } diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php index 92c3780fe..6b232800e 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectManager; class LoadDocumentCategory extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 35010; } diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php index 1d2668c12..fef5066aa 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php @@ -25,7 +25,7 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface { public static $refs = []; - public function getOrder() + public function getOrder(): int { return 30000; } diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index db431c858..94a467e82 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -58,7 +58,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa return $events; } - public function getOrder() + public function getOrder(): int { return 30010; } diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 87e676730..2464f3bd2 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -23,7 +23,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 30011; } diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index ad0e83bd3..7c347bef6 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -45,7 +45,7 @@ class EventSearch extends AbstractSearch private readonly PaginatorFactory $paginatorFactory, ) {} - public function getOrder() + public function getOrder(): int { return 3000; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index d04ef29e8..9931ad4b5 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -33,7 +33,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $this->faker = \Faker\Factory::create('fr_FR'); } - public function getOrder() + public function getOrder(): int { return 51; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php index d835aad38..5be63a091 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php @@ -31,7 +31,7 @@ class LoadCenters extends AbstractFixture implements OrderedFixtureInterface public static $refs = []; - public function getOrder() + public function getOrder(): int { return 100; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php index 3433eebd7..1f68abd21 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php @@ -25,12 +25,12 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, { private ?ContainerInterface $container = null; - public function getOrder() + public function getOrder(): int { return 20; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { echo "loading countries... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php index 2d74e6977..fa526b59d 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php @@ -38,7 +38,7 @@ class LoadGenders extends AbstractFixture implements OrderedFixtureInterface ], ]; - public function getOrder() + public function getOrder(): int { return 100; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index 8254dec1d..561a3de69 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -20,7 +20,7 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac { public static $refs = []; - public function getOrder() + public function getOrder(): int { return 500; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php index c5c03277f..c88bf748e 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php @@ -33,7 +33,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, // This array contains regional code to not exclude private array $regionalVersionToInclude = ['ro_MD']; - public function getOrder() + public function getOrder(): int { return 10; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php index aab896add..a1185c655 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -25,7 +25,7 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac { private ?ContainerInterface $container = null; - public function getOrder() + public function getOrder(): int { return 52; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 885fc9af6..caaa4b5c0 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -47,7 +47,7 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte public static $refs = []; - public function getOrder() + public function getOrder(): int { return 400; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 29ee21ca6..c307a8563 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -325,7 +325,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface 85800,GIVRAND,FR,85100,46.6822701061,-1.8787272243,INSEE EOF; - public function getOrder() + public function getOrder(): int { return 50; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index 85e3f4ec2..fabcaf5ae 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -44,7 +44,7 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface public static $references = []; - public function getOrder() + public function getOrder(): int { return 300; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php index 10c10de8c..cc39ae46c 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php @@ -46,7 +46,7 @@ class LoadScopes extends AbstractFixture implements OrderedFixtureInterface ], ]; - public function getOrder() + public function getOrder(): int { return 200; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 1c99a3a74..8b148a214 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -54,7 +54,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde private ?ContainerInterface $container = null; - public function getOrder() + public function getOrder(): int { return 1000; } diff --git a/src/Bundle/ChillMainBundle/Search/SearchInterface.php b/src/Bundle/ChillMainBundle/Search/SearchInterface.php index 10d4f2a06..ea919de0d 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchInterface.php +++ b/src/Bundle/ChillMainBundle/Search/SearchInterface.php @@ -37,7 +37,7 @@ interface SearchInterface * * @return int */ - public function getOrder(); + public function getOrder(): int; /** * we may desactive the search interface by default. in this case, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php index fb836ed3a..745307d99 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php @@ -48,7 +48,7 @@ class LoadAccompanyingPeriodClosingMotive extends AbstractFixture implements Ord public static $references = []; - public function getOrder() + public function getOrder(): int { return 9500; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php index e298c2cc3..ee5a6f6f9 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php @@ -38,7 +38,7 @@ class LoadAccompanyingPeriodNotifications extends AbstractFixture implements Dep ], ]; - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php index 8eb0688bd..f0424c547 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php @@ -27,7 +27,7 @@ class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFix private array $phoneCall = ['en' => 'phone call', 'fr' => 'appel téléphonique']; - public function getOrder() + public function getOrder(): int { return 9000; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 44992ebef..be32d92cd 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -28,7 +28,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) {} - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 2acbcbfbd..3a9111e2f 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -40,7 +40,7 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac ) {} // put your code here - public function getOrder() + public function getOrder(): int { return 10003; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index ba2c67a08..de7aa56f8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -38,7 +38,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface $this->loader = new NativeLoader(); } - public function getDependencies() + public function getDependencies(): array { return [ LoadPeople::class, diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php index ddce77d6c..6d93bafce 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php @@ -31,7 +31,7 @@ class LoadMaritalStatus extends AbstractFixture implements OrderedFixtureInterfa ['id' => 'unknown', 'name' => ['en' => 'unknown', 'fr' => 'indéterminé']], ]; - public function getOrder() + public function getOrder(): int { return 9999; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index f1be52959..8bddc08c3 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -241,7 +241,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord $this->loader = new NativeLoader($this->faker); } - public function getOrder() + public function getOrder(): int { return 10000; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index 4b57dd048..dfdf2acab 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -25,7 +25,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 9600; } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php index dc1e7b4dd..0d18feeb7 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php @@ -21,7 +21,7 @@ class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface { public function __construct(private readonly SocialWorkMetadata $importer) {} - public function getOrder() + public function getOrder(): int { return 9500; } diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 8462d5a32..c5c15e125 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -169,7 +169,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf * * @see \Chill\MainBundle\Search\SearchInterface::getOrder() */ - public function getOrder() + public function getOrder(): int { return 100; } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index e32b73544..ea7e647da 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 15001; } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php index 6e4639210..ec1a19ab1 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 15000; } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index 2aa175b80..1ed521a1e 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -24,7 +24,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 14999; } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 222458a25..c0d07c141 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -35,7 +35,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa $this->faker = FakerFactory::create('fr_FR'); } - public function getOrder() + public function getOrder(): int { return 15002; } diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index cb38df91c..9d3385e1e 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -25,12 +25,12 @@ use Doctrine\Persistence\ObjectManager; */ class LoadTaskACL extends AbstractFixture implements OrderedFixtureInterface { - public function getOrder() + public function getOrder(): int { return 16000; } - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { $permissionsGroup = $this->getReference($permissionsGroupRef); diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 7261deba4..41457de99 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -32,7 +32,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); } - public function getDependencies() + public function getDependencies(): array { return [ LoadCenters::class, From 0ac49d1fdeb9c07367091b0cf35222d3815e21f5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 12:24:11 +0100 Subject: [PATCH 12/16] php cs fixes --- .../ChillActivityBundle/DataFixtures/ORM/LoadActivity.php | 8 -------- src/Bundle/ChillMainBundle/Search/SearchInterface.php | 2 -- 2 files changed, 10 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 3a85d46ce..5a769da89 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -84,8 +84,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random activityReason. - * - * @return \Chill\ActivityBundle\Entity\ActivityReason */ private function getRandomActivityReason(): \Chill\ActivityBundle\Entity\ActivityReason { @@ -96,8 +94,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random activityType. - * - * @return \Chill\ActivityBundle\Entity\ActivityType */ private function getRandomActivityType(): \Chill\ActivityBundle\Entity\ActivityType { @@ -108,8 +104,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random scope. - * - * @return \Chill\MainBundle\Entity\Scope */ private function getRandomScope(): \Chill\MainBundle\Entity\Scope { @@ -120,8 +114,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random user. - * - * @return \Chill\MainBundle\Entity\User */ private function getRandomUser(): \Chill\MainBundle\Entity\User { diff --git a/src/Bundle/ChillMainBundle/Search/SearchInterface.php b/src/Bundle/ChillMainBundle/Search/SearchInterface.php index ea919de0d..11bccaaa0 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchInterface.php +++ b/src/Bundle/ChillMainBundle/Search/SearchInterface.php @@ -34,8 +34,6 @@ interface SearchInterface * the order in which the results will appears in the global view. * * (this may be eventually defined in config.yml) - * - * @return int */ public function getOrder(): int; From 19e6ceba28a2958ed88153a31b5c9d84ef236ba7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 12:44:14 +0100 Subject: [PATCH 13/16] Add second parameter to add-, get-, hasReference() methods in fixture classes --- .../DataFixtures/ORM/LoadActivity.php | 8 ++++---- .../DataFixtures/ORM/LoadActivityReason.php | 2 +- .../DataFixtures/ORM/LoadActivityType.php | 2 +- .../DataFixtures/ORM/LoadActivitytACL.php | 4 ++-- .../src/DataFixtures/ORM/LoadAsideActivity.php | 2 +- .../DataFixtures/ORM/LoadCalendarACL.php | 2 +- .../DataFixtures/ORM/LoadInvite.php | 2 +- .../DataFixtures/ORM/LoadDocumentACL.php | 4 ++-- .../DataFixtures/ORM/LoadParticipation.php | 5 +++-- .../DataFixtures/ORM/LoadRolesACL.php | 4 ++-- .../ORM/LoadAbstractNotificationsTrait.php | 6 +++--- .../DataFixtures/ORM/LoadAddressReferences.php | 3 ++- .../DataFixtures/ORM/LoadGroupCenters.php | 4 ++-- .../DataFixtures/ORM/LoadPermissionsGroup.php | 2 +- .../DataFixtures/ORM/LoadPostalCodes.php | 2 +- .../DataFixtures/ORM/LoadRoleScopes.php | 4 ++-- .../ChillMainBundle/DataFixtures/ORM/LoadUsers.php | 2 +- .../DataFixtures/ORM/LoadAccompanyingPeriodWork.php | 8 ++++---- .../DataFixtures/ORM/LoadHousehold.php | 8 ++++---- .../DataFixtures/ORM/LoadPeople.php | 6 +++--- .../DataFixtures/ORM/LoadPersonACL.php | 4 ++-- .../DataFixtures/ORM/LoadRelationships.php | 4 ++-- .../DataFixtures/ORM/LoadCustomField.php | 6 +++--- .../DataFixtures/ORM/LoadReportACL.php | 4 ++-- .../DataFixtures/ORM/LoadReports.php | 12 ++++++------ .../ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php | 4 ++-- .../DataFixtures/ORM/LoadThirdParty.php | 6 +++--- 27 files changed, 61 insertions(+), 59 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 5a769da89..8288f5c74 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -89,7 +89,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; - return $this->getReference($reasonRef); + return $this->getReference($reasonRef, null); } /** @@ -99,7 +99,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; - return $this->getReference($typeRef); + return $this->getReference($typeRef, null); } /** @@ -109,7 +109,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; - return $this->getReference($scopeRef); + return $this->getReference($scopeRef, null); } /** @@ -119,6 +119,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef); + return $this->getReference($userRef, null); } } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index 5633bffe3..513a786a8 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -56,7 +56,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf $activityReason = (new ActivityReason()) ->setName($r['name']) ->setActive(true) - ->setCategory($this->getReference($r['category'])); + ->setCategory($this->getReference($r['category'], null)); $manager->persist($activityReason); $reference = 'activity_reason_'.$r['name']['en']; $this->addReference($reference, $activityReason); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 683d28eb4..7af12764e 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -57,7 +57,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface echo 'Creating activity type : '.$t['name']['fr'].' (cat:'.$t['category']." \n"; $activityType = (new ActivityType()) ->setName($t['name']) - ->setCategory($this->getReference('activity_type_cat_'.$t['category'])) + ->setCategory($this->getReference('activity_type_cat_'.$t['category'], null)) ->setSocialIssuesVisible(1) ->setSocialActionsVisible(1); $manager->persist($activityType); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index 96e124b18..0dbeb4aaf 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -34,10 +34,10 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index 75cac30a1..e3b6359fe 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -43,7 +43,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface ->setUpdatedAt(new \DateTimeImmutable('now')) ->setUpdatedBy($user) ->setType( - $this->getReference('aside_activity_category_0') + $this->getReference('aside_activity_category_0', null) ) ->setDate((new \DateTimeImmutable('today')) ->sub(new \DateInterval('P'.\random_int(1, 100).'D'))); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php index 2ef7365ca..66430208b 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php @@ -37,7 +37,7 @@ class LoadCalendarACL extends Fixture implements OrderedFixtureInterface foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { /** @var PermissionsGroup $group */ - $group = $this->getReference($permissionGroupRef); + $group = $this->getReference($permissionGroupRef, null); foreach ($roleScopes as $scope) { $group->addRoleScope($scope); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php index f677a4283..e869737c6 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php @@ -63,6 +63,6 @@ class LoadInvite extends Fixture implements FixtureGroupInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef); + return $this->getReference($userRef, null); } } diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index 4b4377462..cbb8c60e8 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -32,11 +32,11 @@ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index 2649fe78e..fbd3b5443 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -44,11 +44,12 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa $event = (new Event()) ->setDate($this->faker->dateTimeBetween('-2 years', '+6 months')) ->setName($this->faker->words(random_int(2, 4), true)) - ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)])) + ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], null)) ->setCenter($center) ->setCircle( $this->getReference( - LoadScopes::$references[array_rand(LoadScopes::$references)] + LoadScopes::$references[array_rand(LoadScopes::$references)], + null ) ); $manager->persist($event); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 23ee1ee06..52dbecee8 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -31,10 +31,10 @@ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php index 0e9eb3f84..096c52d2a 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php @@ -24,20 +24,20 @@ trait LoadAbstractNotificationsTrait return; foreach ($this->notifs as $notif) { - $entityId = $this->getReference($notif['entityRef'])->getId(); + $entityId = $this->getReference($notif['entityRef'], null)->getId(); echo 'Adding notification for '.$notif['entityClass'].'(entity id:'.$entityId.")\n"; $newNotif = (new Notification()) ->setMessage($notif['message']) - ->setSender($this->getReference($notif['sender'])) + ->setSender($this->getReference($notif['sender'], null)) ->setRelatedEntityClass($notif['entityClass']) ->setRelatedEntityId($entityId) ->setDate(new \DateTimeImmutable('now')) ->setRead([]); foreach ($notif['addressees'] as $addressee) { - $newNotif->addAddressee($this->getReference($addressee)); + $newNotif->addAddressee($this->getReference($addressee, null)); } $manager->persist($newNotif); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index 7b79c0b75..2d09412f9 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -69,7 +69,8 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $ar->setStreetNumber((string) random_int(0, 199)); $ar->setPoint($this->getRandomPoint()); $ar->setPostcode($this->getReference( - LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)] + LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)], + null )); $ar->setMunicipalityCode($ar->getPostcode()->getCode()); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index 45170fa24..b4fbb7bb8 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -30,8 +30,8 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac foreach (LoadCenters::$refs as $centerRef) { foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { $GroupCenter = new GroupCenter(); - $GroupCenter->setCenter($this->getReference($centerRef)); - $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef)); + $GroupCenter->setCenter($this->getReference($centerRef, null)); + $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef, null)); $manager->persist($GroupCenter); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 07f41a515..2ef682259 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -59,7 +59,7 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte $permissionGroup->setName($new['name']); foreach ($new['role_scopes'] as $roleScopeRef) { - $permissionGroup->addRoleScope($this->getReference($roleScopeRef)); + $permissionGroup->addRoleScope($this->getReference($roleScopeRef, null)); } $manager->persist($permissionGroup); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 0e9ecbde5..68f220d74 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -365,7 +365,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface $manager->persist($c); $ref = 'postal_code_'.$code[0]; - if (!$this->hasReference($ref)) { + if (!$this->hasReference($ref, null)) { $this->addReference($ref, $c); self::$refs[] = $ref; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index ad431c148..aff69c695 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -55,8 +55,8 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface foreach (LoadScopes::$references as $scopeReference) { $roleScope = new RoleScope(); $roleScope->setRole($key) - ->setScope($this->getReference($scopeReference)); - $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference)->getName()['en']; + ->setScope($this->getReference($scopeReference, null)); + $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, null)->getName()['en']; echo "Creating {$reference} \n"; $this->addReference($reference, $roleScope); $manager->persist($roleScope); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 166a27c9e..aa25593b3 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -80,7 +80,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde ->setEmail(sprintf('%s@chill.social', \str_replace(' ', '', (string) $username))); foreach ($params['groupCenterRefs'] as $groupCenterRef) { - $user->addGroupCenter($this->getReference($groupCenterRef)); + $user->addGroupCenter($this->getReference($groupCenterRef, null)); } echo 'Creating user '.$username."... \n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index e24cca688..1f2282082 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -64,9 +64,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social')) + ->setCreatedBy($this->getReference('center a_social', null)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social')); + ->setUpdatedBy($this->getReference('center a_social', null)); $manager->persist($work); if ($action->getEvaluations()->count() > 0) { @@ -91,9 +91,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social')) + ->setCreatedBy($this->getReference('center a_social', null)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social')); + ->setUpdatedBy($this->getReference('center a_social', null)); $manager->persist($work); $ev = new AccompanyingPeriod\AccompanyingPeriodWorkEvaluation(); $ev->setAccompanyingPeriodWork($work) diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index cf9a2b1e0..a3543870f 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -127,7 +127,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface foreach ($this->getRandomPersons(1, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::ADULT); + $position = $this->getReference(LoadHouseholdPosition::ADULT, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -136,7 +136,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children foreach ($this->getRandomPersons(0, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD); + $position = $this->getReference(LoadHouseholdPosition::CHILD, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -145,7 +145,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children out foreach ($this->getRandomPersons(0, 2) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT); + $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -161,7 +161,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface { $ref = LoadPostalCodes::$refs[\array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } private function getRandomPersons(int $min, int $max): array diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index 4f2ca1e5c..9a1d2bc54 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -358,8 +358,8 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord if (\random_int(0, 10) > 3) { // always add social scope: - $accompanyingPeriod->addScope($this->getReference('scope_social')); - $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN); + $accompanyingPeriod->addScope($this->getReference('scope_social', null)); + $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN, null); $accompanyingPeriod->setOrigin($origin); $accompanyingPeriod->setIntensity('regular'); $accompanyingPeriod->setAddressLocation($this->createAddress()); @@ -472,7 +472,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord { $ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } private function getRandomSocialIssue(): SocialIssue diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index ec17b6f0a..7b46d7c06 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -33,8 +33,8 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); - $scopeSocial = $this->getReference('scope_social'); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $scopeSocial = $this->getReference('scope_social', null); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 3efcc6386..eeb42164a 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -46,7 +46,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface ->setFromPerson($this->getRandomPerson($this->em)) ->setToPerson($this->getRandomPerson($this->em)) ->setRelation($this->getReference(LoadRelations::RELATION_KEY. - random_int(0, \count(LoadRelations::RELATIONS) - 1))) + random_int(0, \count(LoadRelations::RELATIONS) - 1), null)) ->setReverse((bool) random_int(0, 1)) ->setCreatedBy($user) ->setUpdatedBy($user) @@ -74,6 +74,6 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef); + return $this->getReference($userRef, null); } } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index d4b984e11..f8493f4c8 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -74,7 +74,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface ->setOptions($cFType['options']) ->setName(['fr' => "CustomField {$i}"]) ->setOrdering(random_int(0, 1000) / 1000) - ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3))); + ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3), null)); $manager->persist($customField); } @@ -87,7 +87,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface private function createExpectedFields(ObjectManager $manager) { // report logement - $reportLogement = $this->getReference('cf_group_report_logement'); + $reportLogement = $this->getReference('cf_group_report_logement', null); $houseTitle = (new CustomField()) ->setSlug('house_title') @@ -143,7 +143,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface $manager->persist($descriptionLogement); // report problems - $reportEducation = $this->getReference('cf_group_report_education'); + $reportEducation = $this->getReference('cf_group_report_education', null); $title = (new CustomField()) ->setSlug('title') diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index dd79fe3f3..6776ece5d 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -32,11 +32,11 @@ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index f757ea2fa..287705661 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -60,9 +60,9 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa if (null !== $charline) { $report = (new Report()) ->setPerson($charline) - ->setCFGroup($this->getReference('cf_group_report_logement')) + ->setCFGroup($this->getReference('cf_group_report_logement', null)) ->setDate(new \DateTime('2015-01-05')) - ->setScope($this->getReference('scope_social')); + ->setScope($this->getReference('scope_social', null)); $this->fillReport($report); $manager->persist($report); @@ -81,8 +81,8 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa ->setPerson($person) ->setCFGroup( random_int(0, 10) > 5 ? - $this->getReference('cf_group_report_logement') : - $this->getReference('cf_group_report_education') + $this->getReference('cf_group_report_logement', null) : + $this->getReference('cf_group_report_education', null) ) ->setScope($this->getScopeRandom()); $this->fillReport($report); @@ -95,7 +95,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa // setUser $usernameRef = array_rand(LoadUsers::$refs); $report->setUser( - $this->getReference($usernameRef) + $this->getReference($usernameRef, null) ); // set date if null @@ -214,7 +214,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa { $ref = LoadScopes::$references[array_rand(LoadScopes::$references)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } /** diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index 9d3385e1e..14b72ed54 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -33,10 +33,10 @@ class LoadTaskACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 8eb5dd48c..74713015c 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -70,10 +70,10 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface $number = random_int(1, \count($references)); if (1 === $number) { - yield $this->getReference($references[array_rand($references)]); + yield $this->getReference($references[array_rand($references)], null); } else { foreach (array_rand($references, $number) as $index) { - yield $this->getReference($references[$index]); + yield $this->getReference($references[$index], null); } } } @@ -82,7 +82,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface { $ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } private function getThirdParties(): ObjectSet From f820273dd7396622840d05aaa0cb27e6e148da57 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 13:28:52 +0100 Subject: [PATCH 14/16] Pass class as second parameter to getReference() fixture method --- .../DataFixtures/ORM/LoadActivity.php | 12 ++++++++---- .../DataFixtures/ORM/LoadActivityReason.php | 3 ++- .../DataFixtures/ORM/LoadActivityType.php | 3 ++- .../DataFixtures/ORM/LoadActivitytACL.php | 6 ++++-- .../src/DataFixtures/ORM/LoadAsideActivity.php | 3 ++- .../DataFixtures/ORM/LoadCalendarACL.php | 2 +- .../DataFixtures/ORM/LoadInvite.php | 2 +- .../DataFixtures/ORM/LoadDocumentACL.php | 6 ++++-- .../DataFixtures/ORM/LoadParticipation.php | 6 ++++-- .../DataFixtures/ORM/LoadRolesACL.php | 6 ++++-- .../ORM/LoadAbstractNotificationsTrait.php | 6 +++--- .../DataFixtures/ORM/LoadAddressReferences.php | 3 ++- .../DataFixtures/ORM/LoadGroupCenters.php | 6 ++++-- .../DataFixtures/ORM/LoadPermissionsGroup.php | 3 ++- .../DataFixtures/ORM/LoadPostalCodes.php | 2 +- .../DataFixtures/ORM/LoadRoleScopes.php | 5 +++-- .../DataFixtures/ORM/LoadUsers.php | 3 ++- .../ORM/LoadAccompanyingPeriodWork.php | 9 +++++---- .../DataFixtures/ORM/LoadHousehold.php | 9 +++++---- .../DataFixtures/ORM/LoadPeople.php | 6 +++--- .../DataFixtures/ORM/LoadPersonACL.php | 6 ++++-- .../DataFixtures/ORM/LoadRelationships.php | 5 +++-- .../DataFixtures/ORM/LoadCustomField.php | 7 ++++--- .../DataFixtures/ORM/LoadReportACL.php | 6 ++++-- .../DataFixtures/ORM/LoadReports.php | 15 +++++++++------ .../DataFixtures/ORM/LoadTaskACL.php | 6 ++++-- .../DataFixtures/ORM/LoadThirdParty.php | 7 ++++--- 27 files changed, 94 insertions(+), 59 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 8288f5c74..dd3ba3b6a 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -12,8 +12,12 @@ declare(strict_types=1); namespace Chill\ActivityBundle\DataFixtures\ORM; use Chill\ActivityBundle\Entity\Activity; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\ActivityBundle\Entity\ActivityType; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; use Chill\MainBundle\DataFixtures\ORM\LoadUsers; +use Chill\MainBundle\Entity\Scope; +use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\Person; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; @@ -89,7 +93,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; - return $this->getReference($reasonRef, null); + return $this->getReference($reasonRef, ActivityReason::class); } /** @@ -99,7 +103,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; - return $this->getReference($typeRef, null); + return $this->getReference($typeRef, ActivityType::class); } /** @@ -109,7 +113,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; - return $this->getReference($scopeRef, null); + return $this->getReference($scopeRef, Scope::class); } /** @@ -119,6 +123,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef, null); + return $this->getReference($userRef, User::class); } } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index 513a786a8..f39b922ba 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\DataFixtures\ORM; use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -56,7 +57,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf $activityReason = (new ActivityReason()) ->setName($r['name']) ->setActive(true) - ->setCategory($this->getReference($r['category'], null)); + ->setCategory($this->getReference($r['category'], ActivityReasonCategory::class)); $manager->persist($activityReason); $reference = 'activity_reason_'.$r['name']['en']; $this->addReference($reference, $activityReason); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 7af12764e..ee1dcb510 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\DataFixtures\ORM; use Chill\ActivityBundle\Entity\ActivityType; +use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -57,7 +58,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface echo 'Creating activity type : '.$t['name']['fr'].' (cat:'.$t['category']." \n"; $activityType = (new ActivityType()) ->setName($t['name']) - ->setCategory($this->getReference('activity_type_cat_'.$t['category'], null)) + ->setCategory($this->getReference('activity_type_cat_'.$t['category'], ActivityTypeCategory::class)) ->setSocialIssuesVisible(1) ->setSocialActionsVisible(1); $manager->persist($activityType); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index 0dbeb4aaf..fcff80f62 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -15,7 +15,9 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -34,10 +36,10 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef, null); + $scope = $this->getReference($scopeRef, Scope::class); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index e3b6359fe..a60398507 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\DataFixtures\ORM; use Chill\AsideActivityBundle\Entity\AsideActivity; +use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\MainBundle\DataFixtures\ORM\LoadUsers; use Chill\MainBundle\Repository\UserRepository; use Doctrine\Bundle\FixturesBundle\Fixture; @@ -43,7 +44,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface ->setUpdatedAt(new \DateTimeImmutable('now')) ->setUpdatedBy($user) ->setType( - $this->getReference('aside_activity_category_0', null) + $this->getReference('aside_activity_category_0', AsideActivityCategory::class) ) ->setDate((new \DateTimeImmutable('today')) ->sub(new \DateInterval('P'.\random_int(1, 100).'D'))); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php index 66430208b..471f9a81a 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php @@ -37,7 +37,7 @@ class LoadCalendarACL extends Fixture implements OrderedFixtureInterface foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { /** @var PermissionsGroup $group */ - $group = $this->getReference($permissionGroupRef, null); + $group = $this->getReference($permissionGroupRef, PermissionsGroup::class); foreach ($roleScopes as $scope) { $group->addRoleScope($scope); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php index e869737c6..f2cd6e032 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php @@ -63,6 +63,6 @@ class LoadInvite extends Fixture implements FixtureGroupInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef, null); + return $this->getReference($userRef, User::class); } } diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index cbb8c60e8..df52b848b 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -14,7 +14,9 @@ namespace Chill\DocStoreBundle\DataFixtures\ORM; use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -32,11 +34,11 @@ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef, null); + $scope = $this->getReference($scopeRef, Scope::class); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index fbd3b5443..94167f6b8 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -12,9 +12,11 @@ declare(strict_types=1); namespace Chill\EventBundle\DataFixtures\ORM; use Chill\EventBundle\Entity\Event; +use Chill\EventBundle\Entity\EventType; use Chill\EventBundle\Entity\Participation; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; use Chill\MainBundle\Entity\Center; +use Chill\MainBundle\Entity\Scope; use Chill\PersonBundle\Entity\Person; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; @@ -44,12 +46,12 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa $event = (new Event()) ->setDate($this->faker->dateTimeBetween('-2 years', '+6 months')) ->setName($this->faker->words(random_int(2, 4), true)) - ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], null)) + ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], EventType::class)) ->setCenter($center) ->setCircle( $this->getReference( LoadScopes::$references[array_rand(LoadScopes::$references)], - null + Scope::class ) ); $manager->persist($event); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 52dbecee8..1619b3b38 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -13,7 +13,9 @@ namespace Chill\EventBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -31,10 +33,10 @@ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef, null); + $scope = $this->getReference($scopeRef, Scope::class); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php index 096c52d2a..6df6a7a51 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php @@ -24,20 +24,20 @@ trait LoadAbstractNotificationsTrait return; foreach ($this->notifs as $notif) { - $entityId = $this->getReference($notif['entityRef'], null)->getId(); + $entityId = $this->getReference($notif['entityRef'], Notification::class)->getId(); echo 'Adding notification for '.$notif['entityClass'].'(entity id:'.$entityId.")\n"; $newNotif = (new Notification()) ->setMessage($notif['message']) - ->setSender($this->getReference($notif['sender'], null)) + ->setSender($this->getReference($notif['sender'], Notification::class)) ->setRelatedEntityClass($notif['entityClass']) ->setRelatedEntityId($entityId) ->setDate(new \DateTimeImmutable('now')) ->setRead([]); foreach ($notif['addressees'] as $addressee) { - $newNotif->addAddressee($this->getReference($addressee, null)); + $newNotif->addAddressee($this->getReference($addressee, Notification::class)); } $manager->persist($newNotif); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index 2d09412f9..1c71e17cb 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\DataFixtures\ORM; use Chill\MainBundle\Doctrine\Model\Point; use Chill\MainBundle\Entity\AddressReference; +use Chill\MainBundle\Entity\PostalCode; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -70,7 +71,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $ar->setPoint($this->getRandomPoint()); $ar->setPostcode($this->getReference( LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)], - null + PostalCode::class )); $ar->setMunicipalityCode($ar->getPostcode()->getCode()); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index b4fbb7bb8..8c9d37ec0 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -11,7 +11,9 @@ declare(strict_types=1); namespace Chill\MainBundle\DataFixtures\ORM; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\GroupCenter; +use Chill\MainBundle\Entity\PermissionsGroup; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -30,8 +32,8 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac foreach (LoadCenters::$refs as $centerRef) { foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { $GroupCenter = new GroupCenter(); - $GroupCenter->setCenter($this->getReference($centerRef, null)); - $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef, null)); + $GroupCenter->setCenter($this->getReference($centerRef, Center::class)); + $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef, PermissionsGroup::class)); $manager->persist($GroupCenter); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 2ef682259..3bc39a438 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\DataFixtures\ORM; use Chill\MainBundle\Entity\PermissionsGroup; +use Chill\MainBundle\Entity\RoleScope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -59,7 +60,7 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte $permissionGroup->setName($new['name']); foreach ($new['role_scopes'] as $roleScopeRef) { - $permissionGroup->addRoleScope($this->getReference($roleScopeRef, null)); + $permissionGroup->addRoleScope($this->getReference($roleScopeRef, RoleScope::class)); } $manager->persist($permissionGroup); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 68f220d74..b1cebbaab 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -365,7 +365,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface $manager->persist($c); $ref = 'postal_code_'.$code[0]; - if (!$this->hasReference($ref, null)) { + if (!$this->hasReference($ref, PostalCode::class)) { $this->addReference($ref, $c); self::$refs[] = $ref; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index aff69c695..a74ec9c64 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\DataFixtures\ORM; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -55,8 +56,8 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface foreach (LoadScopes::$references as $scopeReference) { $roleScope = new RoleScope(); $roleScope->setRole($key) - ->setScope($this->getReference($scopeReference, null)); - $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, null)->getName()['en']; + ->setScope($this->getReference($scopeReference, Scope::class)); + $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, Scope::class)->getName()['en']; echo "Creating {$reference} \n"; $this->addReference($reference, $roleScope); $manager->persist($roleScope); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index aa25593b3..3afdefbab 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\MainBundle\DataFixtures\ORM; +use Chill\MainBundle\Entity\GroupCenter; use Chill\MainBundle\Entity\User; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; @@ -80,7 +81,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde ->setEmail(sprintf('%s@chill.social', \str_replace(' ', '', (string) $username))); foreach ($params['groupCenterRefs'] as $groupCenterRef) { - $user->addGroupCenter($this->getReference($groupCenterRef, null)); + $user->addGroupCenter($this->getReference($groupCenterRef, GroupCenter::class)); } echo 'Creating user '.$username."... \n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 1f2282082..60df2fd5f 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\DataFixtures\ORM; +use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\SocialWork\Evaluation; use Chill\PersonBundle\Entity\SocialWork\SocialAction; @@ -64,9 +65,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social', null)) + ->setCreatedBy($this->getReference('center a_social', User::class)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social', null)); + ->setUpdatedBy($this->getReference('center a_social', User::class)); $manager->persist($work); if ($action->getEvaluations()->count() > 0) { @@ -91,9 +92,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social', null)) + ->setCreatedBy($this->getReference('center a_social', User::class)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social', null)); + ->setUpdatedBy($this->getReference('center a_social', User::class)); $manager->persist($work); $ev = new AccompanyingPeriod\AccompanyingPeriodWorkEvaluation(); $ev->setAccompanyingPeriodWork($work) diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index a3543870f..fdefa5dc8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -16,6 +16,7 @@ use Chill\MainBundle\DataFixtures\ORM\LoadPostalCodes; use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\PostalCode; use Chill\PersonBundle\Entity\Household\Household; +use Chill\PersonBundle\Entity\Household\Position; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person\PersonCenterHistory; use Chill\PersonBundle\Household\MembersEditorFactory; @@ -127,7 +128,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface foreach ($this->getRandomPersons(1, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::ADULT, null); + $position = $this->getReference(LoadHouseholdPosition::ADULT, Position::class); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -136,7 +137,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children foreach ($this->getRandomPersons(0, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD, null); + $position = $this->getReference(LoadHouseholdPosition::CHILD, Position::class); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -145,7 +146,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children out foreach ($this->getRandomPersons(0, 2) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT, null); + $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT, Position::class); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -161,7 +162,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface { $ref = LoadPostalCodes::$refs[\array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref, null); + return $this->getReference($ref, PostalCode::class); } private function getRandomPersons(int $min, int $max): array diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index 9a1d2bc54..d5299af14 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -358,8 +358,8 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord if (\random_int(0, 10) > 3) { // always add social scope: - $accompanyingPeriod->addScope($this->getReference('scope_social', null)); - $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN, null); + $accompanyingPeriod->addScope($this->getReference('scope_social', Scope::class)); + $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN, AccompanyingPeriod\Origin::class); $accompanyingPeriod->setOrigin($origin); $accompanyingPeriod->setIntensity('regular'); $accompanyingPeriod->setAddressLocation($this->createAddress()); @@ -472,7 +472,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord { $ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref, null); + return $this->getReference($ref, PostalCode::class); } private function getRandomSocialIssue(): SocialIssue diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index 7b46d7c06..767923bb6 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -12,7 +12,9 @@ declare(strict_types=1); namespace Chill\PersonBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\Common\DataFixtures\AbstractFixture; @@ -33,8 +35,8 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); - $scopeSocial = $this->getReference('scope_social', null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); + $scopeSocial = $this->getReference('scope_social', Scope::class); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index eeb42164a..dcbb3a4c3 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -14,6 +14,7 @@ namespace Chill\PersonBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadUsers; use Chill\MainBundle\Entity\User; use Chill\PersonBundle\DataFixtures\Helper\PersonRandomHelper; +use Chill\PersonBundle\Entity\Relationships\Relation; use Chill\PersonBundle\Entity\Relationships\Relationship; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\DataFixtures\DependentFixtureInterface; @@ -46,7 +47,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface ->setFromPerson($this->getRandomPerson($this->em)) ->setToPerson($this->getRandomPerson($this->em)) ->setRelation($this->getReference(LoadRelations::RELATION_KEY. - random_int(0, \count(LoadRelations::RELATIONS) - 1), null)) + random_int(0, \count(LoadRelations::RELATIONS) - 1), Relation::class)) ->setReverse((bool) random_int(0, 1)) ->setCreatedBy($user) ->setUpdatedBy($user) @@ -74,6 +75,6 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef, null); + return $this->getReference($userRef, User::class); } } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index f8493f4c8..707133890 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\ReportBundle\DataFixtures\ORM; use Chill\CustomFieldsBundle\Entity\CustomField; +use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -74,7 +75,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface ->setOptions($cFType['options']) ->setName(['fr' => "CustomField {$i}"]) ->setOrdering(random_int(0, 1000) / 1000) - ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3), null)); + ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3), CustomFieldsGroup::class)); $manager->persist($customField); } @@ -87,7 +88,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface private function createExpectedFields(ObjectManager $manager) { // report logement - $reportLogement = $this->getReference('cf_group_report_logement', null); + $reportLogement = $this->getReference('cf_group_report_logement', CustomFieldsGroup::class); $houseTitle = (new CustomField()) ->setSlug('house_title') @@ -143,7 +144,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface $manager->persist($descriptionLogement); // report problems - $reportEducation = $this->getReference('cf_group_report_education', null); + $reportEducation = $this->getReference('cf_group_report_education', CustomFieldsGroup::class); $title = (new CustomField()) ->setSlug('title') diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index 6776ece5d..cb375d30f 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -13,7 +13,9 @@ namespace Chill\ReportBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -32,11 +34,11 @@ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef, null); + $scope = $this->getReference($scopeRef, Scope::class); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 287705661..2a89982d8 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -12,8 +12,11 @@ declare(strict_types=1); namespace Chill\ReportBundle\DataFixtures\ORM; use Chill\CustomFieldsBundle\Entity\CustomField; +use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; use Chill\MainBundle\DataFixtures\ORM\LoadUsers; +use Chill\MainBundle\Entity\Scope; +use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\Person; use Chill\ReportBundle\Entity\Report; use Doctrine\Common\DataFixtures\AbstractFixture; @@ -60,9 +63,9 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa if (null !== $charline) { $report = (new Report()) ->setPerson($charline) - ->setCFGroup($this->getReference('cf_group_report_logement', null)) + ->setCFGroup($this->getReference('cf_group_report_logement', CustomFieldsGroup::class)) ->setDate(new \DateTime('2015-01-05')) - ->setScope($this->getReference('scope_social', null)); + ->setScope($this->getReference('scope_social', Scope::class)); $this->fillReport($report); $manager->persist($report); @@ -81,8 +84,8 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa ->setPerson($person) ->setCFGroup( random_int(0, 10) > 5 ? - $this->getReference('cf_group_report_logement', null) : - $this->getReference('cf_group_report_education', null) + $this->getReference('cf_group_report_logement', CustomFieldsGroup::class) : + $this->getReference('cf_group_report_education', CustomFieldsGroup::class) ) ->setScope($this->getScopeRandom()); $this->fillReport($report); @@ -95,7 +98,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa // setUser $usernameRef = array_rand(LoadUsers::$refs); $report->setUser( - $this->getReference($usernameRef, null) + $this->getReference($usernameRef, User::class) ); // set date if null @@ -214,7 +217,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa { $ref = LoadScopes::$references[array_rand(LoadScopes::$references)]; - return $this->getReference($ref, null); + return $this->getReference($ref, Scope::class); } /** diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index 14b72ed54..23043d1e9 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -13,7 +13,9 @@ namespace Chill\TaskBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\MainBundle\Entity\PermissionsGroup; use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\Entity\Scope; use Chill\TaskBundle\Security\Authorization\TaskVoter; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; @@ -33,10 +35,10 @@ class LoadTaskACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $permissionsGroup = $this->getReference($permissionsGroupRef, PermissionsGroup::class); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef, null); + $scope = $this->getReference($scopeRef, Scope::class); // create permission group switch ($permissionsGroup->getName()) { case 'social': diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 74713015c..dc4b5472b 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -14,6 +14,7 @@ namespace Chill\ThirdPartyBundle\DataFixtures\ORM; use Chill\MainBundle\DataFixtures\ORM\LoadCenters; use Chill\MainBundle\DataFixtures\ORM\LoadPostalCodes; use Chill\MainBundle\Entity\Address; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\PostalCode; use Chill\ThirdPartyBundle\Entity\ThirdParty; use Doctrine\Bundle\FixturesBundle\Fixture; @@ -70,10 +71,10 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface $number = random_int(1, \count($references)); if (1 === $number) { - yield $this->getReference($references[array_rand($references)], null); + yield $this->getReference($references[array_rand($references)], Center::class); } else { foreach (array_rand($references, $number) as $index) { - yield $this->getReference($references[$index], null); + yield $this->getReference($references[$index], Center::class); } } } @@ -82,7 +83,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface { $ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref, null); + return $this->getReference($ref, PostalCode::class); } private function getThirdParties(): ObjectSet From a4510e26972fbabef8475a2598763e007ea7c43f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 13:34:38 +0100 Subject: [PATCH 15/16] php cs fixes --- .../ChillActivityBundle/DataFixtures/ORM/LoadActivity.php | 8 ++++---- .../ChillReportBundle/DataFixtures/ORM/LoadReports.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index dd3ba3b6a..80c1e4254 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -89,7 +89,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random activityReason. */ - private function getRandomActivityReason(): \Chill\ActivityBundle\Entity\ActivityReason + private function getRandomActivityReason(): ActivityReason { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; @@ -99,7 +99,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random activityType. */ - private function getRandomActivityType(): \Chill\ActivityBundle\Entity\ActivityType + private function getRandomActivityType(): ActivityType { $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; @@ -109,7 +109,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random scope. */ - private function getRandomScope(): \Chill\MainBundle\Entity\Scope + private function getRandomScope(): Scope { $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; @@ -119,7 +119,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface /** * Return a random user. */ - private function getRandomUser(): \Chill\MainBundle\Entity\User + private function getRandomUser(): User { $userRef = array_rand(LoadUsers::$refs); diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 2a89982d8..3519ef4cd 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -211,7 +211,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa } /** - * @return \Chill\MainBundle\Entity\Scope + * @return Scope */ private function getScopeRandom() { From 0fb822e7c1ad620a92731bd54c027733a70c6b60 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 28 Nov 2024 13:48:55 +0100 Subject: [PATCH 16/16] Add changie --- .changes/unreleased/Fixed-20241128-134834.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/unreleased/Fixed-20241128-134834.yaml diff --git a/.changes/unreleased/Fixed-20241128-134834.yaml b/.changes/unreleased/Fixed-20241128-134834.yaml new file mode 100644 index 000000000..f06f2c1fb --- /dev/null +++ b/.changes/unreleased/Fixed-20241128-134834.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Fix the serialization of gender for the generation of documents +time: 2024-11-28T13:48:34.528958771+01:00 +custom: + Issue: "329"