From f1ff507d0a17062bf0f53e65fa30e495b0bda239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 2 Jul 2025 11:28:47 +0200 Subject: [PATCH] Apply some rector transformations --- .../RemoveExportGenerationMessageHandler.php | 2 +- .../RemoveExpiredExportGenerationCronJobTest.php | 7 +++---- .../Form/Type/PickSocialActionType.php | 16 +++++++--------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Export/Messenger/RemoveExportGenerationMessageHandler.php b/src/Bundle/ChillMainBundle/Export/Messenger/RemoveExportGenerationMessageHandler.php index e3e3063ca..c1f59a8fd 100644 --- a/src/Bundle/ChillMainBundle/Export/Messenger/RemoveExportGenerationMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Export/Messenger/RemoveExportGenerationMessageHandler.php @@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException; use Symfony\Component\Messenger\Handler\MessageHandlerInterface; #[AsMessageHandler] -class RemoveExportGenerationMessageHandler implements MessageHandlerInterface +final readonly class RemoveExportGenerationMessageHandler implements MessageHandlerInterface { private const LOG_PREFIX = '[RemoveExportGenerationMessageHandler] '; diff --git a/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php b/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php index 21c47aaf0..920e59d22 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php @@ -93,11 +93,10 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase new ExportGeneration('dummy', []), ]; - $repo->findExpiredExportGeneration(Argument::that(function ($dateTime) use ($clock) { + $repo->findExpiredExportGeneration(Argument::that(fn($dateTime) => // Ensure the repository is called with the current clock time - return $dateTime instanceof \DateTimeImmutable - && $dateTime->getTimestamp() === $clock->now()->getTimestamp(); - }))->willReturn($expiredExports); + $dateTime instanceof \DateTimeImmutable + && $dateTime->getTimestamp() === $clock->now()->getTimestamp()))->willReturn($expiredExports); // Expect one RemoveExportGenerationMessage for each expired export $bus->dispatch(Argument::that(fn (Envelope $envelope) => $envelope->getMessage() instanceof RemoveExportGenerationMessage)) diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php index 1e6f2ba1a..39aa5a4cb 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php @@ -37,15 +37,13 @@ class PickSocialActionType extends AbstractType 'show_social_issue_parenthesis' => false, 'show_deactivated' => false, ]) - ->setNormalizer('choice_label', function (Options $options, $value) { - return fn (SocialAction $sa) => $this->actionRender->renderString( - $sa, - [ - SocialActionRender::SHOW_SOCIAL_ISSUE => $options['show_social_issue_parenthesis'], - SocialActionRender::SHOW_DEACTIVATED => $options['show_deactivated'], - ] - ); - }) + ->setNormalizer('choice_label', fn(Options $options, $value) => fn (SocialAction $sa) => $this->actionRender->renderString( + $sa, + [ + SocialActionRender::SHOW_SOCIAL_ISSUE => $options['show_social_issue_parenthesis'], + SocialActionRender::SHOW_DEACTIVATED => $options['show_deactivated'], + ] + )) ->setAllowedTypes('multiple', ['bool']) ->setAllowedTypes('show_social_issue_parenthesis', ['bool']); }