diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index d0db6cddd..c52875482 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -42,7 +42,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options + * @param array $options * * @throws LoaderError * @throws RuntimeError @@ -54,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -65,7 +65,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options + * @param array $options */ public function renderString($entity, array $options): string { @@ -75,7 +75,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 06ea12d30..0efccc96c 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -39,7 +39,8 @@ class UserRenderTest extends WebTestCase self::bootKernel(); } - #[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void + #[NoReturn] + public function testRenderUserWithJobAndScopeAtCertainDate(): void { self::bootKernel(); $em = self::$container->get(EntityManagerInterface::class); @@ -54,8 +55,7 @@ class UserRenderTest extends WebTestCase ->setActive(true); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); -// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); - + // $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); $userJobB = new UserJob(); $scopeB = new Scope(); @@ -101,8 +101,7 @@ class UserRenderTest extends WebTestCase $em->flush(); // Create renderer - $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) - ->getMock(); + $translatableStringHelperMock = $this->createMock(TranslatableStringHelperInterface::class); $engineMock = $this->createMock(Environment::class); $translatorMock = $this->createMock(TranslatorInterface::class); @@ -114,7 +113,7 @@ class UserRenderTest extends WebTestCase $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); -// dd($user); + // dd($user); // Check that the user render for the first activity corresponds with the first user job $expectedStringA = 'BOB ISLA (assistant social) (service A)'; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 5d6000164..13d25deb8 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -69,7 +69,6 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac ); } - if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(