Apply some rector transformations

This commit is contained in:
Julien Fastré 2025-07-02 11:28:47 +02:00
parent 2a65398277
commit f1ff507d0a
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 11 additions and 14 deletions

View File

@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface; use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
#[AsMessageHandler] #[AsMessageHandler]
class RemoveExportGenerationMessageHandler implements MessageHandlerInterface final readonly class RemoveExportGenerationMessageHandler implements MessageHandlerInterface
{ {
private const LOG_PREFIX = '[RemoveExportGenerationMessageHandler] '; private const LOG_PREFIX = '[RemoveExportGenerationMessageHandler] ';

View File

@ -93,11 +93,10 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase
new ExportGeneration('dummy', []), 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 // Ensure the repository is called with the current clock time
return $dateTime instanceof \DateTimeImmutable $dateTime instanceof \DateTimeImmutable
&& $dateTime->getTimestamp() === $clock->now()->getTimestamp(); && $dateTime->getTimestamp() === $clock->now()->getTimestamp()))->willReturn($expiredExports);
}))->willReturn($expiredExports);
// Expect one RemoveExportGenerationMessage for each expired export // Expect one RemoveExportGenerationMessage for each expired export
$bus->dispatch(Argument::that(fn (Envelope $envelope) => $envelope->getMessage() instanceof RemoveExportGenerationMessage)) $bus->dispatch(Argument::that(fn (Envelope $envelope) => $envelope->getMessage() instanceof RemoveExportGenerationMessage))

View File

@ -37,15 +37,13 @@ class PickSocialActionType extends AbstractType
'show_social_issue_parenthesis' => false, 'show_social_issue_parenthesis' => false,
'show_deactivated' => false, 'show_deactivated' => false,
]) ])
->setNormalizer('choice_label', function (Options $options, $value) { ->setNormalizer('choice_label', fn(Options $options, $value) => fn (SocialAction $sa) => $this->actionRender->renderString(
return fn (SocialAction $sa) => $this->actionRender->renderString( $sa,
$sa, [
[ SocialActionRender::SHOW_SOCIAL_ISSUE => $options['show_social_issue_parenthesis'],
SocialActionRender::SHOW_SOCIAL_ISSUE => $options['show_social_issue_parenthesis'], SocialActionRender::SHOW_DEACTIVATED => $options['show_deactivated'],
SocialActionRender::SHOW_DEACTIVATED => $options['show_deactivated'], ]
] ))
);
})
->setAllowedTypes('multiple', ['bool']) ->setAllowedTypes('multiple', ['bool'])
->setAllowedTypes('show_social_issue_parenthesis', ['bool']); ->setAllowedTypes('show_social_issue_parenthesis', ['bool']);
} }