Run symfonysetlist symfony_62

This commit is contained in:
2025-05-28 15:16:09 +02:00
parent 8ec18a6fb8
commit abb786495a
14 changed files with 61 additions and 80 deletions

View File

@@ -29,10 +29,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class CalendarRangeRemoveToRemoteHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class CalendarRangeRemoveToRemoteHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarRangeRemovedMessage $calendarRangeRemovedMessage): void
{
$this->remoteCalendarConnector->removeCalendarRange(

View File

@@ -30,10 +30,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class CalendarRangeToRemoteHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class CalendarRangeToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) {}
public function __invoke(CalendarRangeMessage $calendarRangeMessage): void
{
$range = $this->calendarRangeRepository->find($calendarRangeMessage->getCalendarRangeId());

View File

@@ -29,10 +29,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class CalendarRemoveHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class CalendarRemoveHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) {}
public function __invoke(CalendarRemovedMessage $message): void
{
if (null !== $message->getAssociatedCalendarRangeId()) {

View File

@@ -35,10 +35,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class CalendarToRemoteHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class CalendarToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarMessage $calendarMessage): void
{
$calendar = $this->calendarRepository->find($calendarMessage->getCalendarId());

View File

@@ -29,10 +29,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class InviteUpdateHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class InviteUpdateHandler
{
public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) {}
public function __invoke(InviteUpdateMessage $inviteUpdateMessage): void
{
if (null === $invite = $this->inviteRepository->find($inviteUpdateMessage->getInviteId())) {

View File

@@ -34,10 +34,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
*
* @AsMessageHandler
*/
class MSGraphChangeNotificationHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class MSGraphChangeNotificationHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) {}
public function __invoke(MSGraphChangeNotificationMessage $changeNotificationMessage): void
{
$user = $this->userRepository->find($changeNotificationMessage->getUserId());

View File

@@ -30,12 +30,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Handle the request of document generation.
*/
class RequestGenerationHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class RequestGenerationHandler
{
final public const AUTHORIZED_TRIALS = 5;
private const LOG_PREFIX = '[docgen message handler] ';
public function __construct(
private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository,
private readonly EntityManagerInterface $entityManager,
@@ -47,7 +46,6 @@ class RequestGenerationHandler implements MessageHandlerInterface
private readonly TempUrlGeneratorInterface $tempUrlGenerator,
private readonly TranslatorInterface $translator,
) {}
public function __invoke(RequestGenerationMessage $message): void
{
if (null === $template = $this->docGeneratorTemplateRepository->find($message->getTemplateId())) {
@@ -119,7 +117,6 @@ class RequestGenerationHandler implements MessageHandlerInterface
'duration_int' => (new \DateTimeImmutable('now'))->getTimestamp() - $message->getCreatedAt()->getTimestamp(),
]);
}
private function sendDataDump(StoredObject $destinationStoredObject, RequestGenerationMessage $message): void
{
$url = $this->tempUrlGenerator->generate('GET', $destinationStoredObject->getFilename(), 3600);

View File

@@ -19,13 +19,13 @@ use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
final readonly class PdfSignedMessageHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class PdfSignedMessageHandler
{
/**
* log prefix.
*/
private const P = '[pdf signed message] ';
public function __construct(
private LoggerInterface $logger,
private EntityWorkflowManager $entityWorkflowManager,
@@ -34,7 +34,6 @@ final readonly class PdfSignedMessageHandler implements MessageHandlerInterface
private EntityManagerInterface $entityManager,
private SignatureStepStateChanger $signatureStepStateChanger,
) {}
public function __invoke(PdfSignedMessage $message): void
{
$this->logger->info(self::P.'a message is received', ['signaturedId' => $message->signatureId]);

View File

@@ -30,10 +30,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
* If a StoredObject is a candidate for deletion (is expired and no more version stored), it is also removed from the
* database.
*/
final readonly class RemoveOldVersionMessageHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class RemoveOldVersionMessageHandler
{
private const LOG_PREFIX = '[RemoveOldVersionMessageHandler] ';
public function __construct(
private StoredObjectVersionRepository $storedObjectVersionRepository,
private LoggerInterface $logger,
@@ -41,7 +41,6 @@ final readonly class RemoveOldVersionMessageHandler implements MessageHandlerInt
private StoredObjectManagerInterface $storedObjectManager,
private ClockInterface $clock,
) {}
/**
* @throws StoredObjectManagerException
*/

View File

@@ -27,15 +27,14 @@ use Symfony\Component\Notifier\TexterInterface;
/**
* @AsMessageHandler
*/
class ShortMessageHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class ShortMessageHandler
{
private readonly PhoneNumberUtil $phoneNumberUtil;
public function __construct(private readonly TexterInterface $texter)
{
$this->phoneNumberUtil = PhoneNumberUtil::getInstance();
}
public function __invoke(ShortMessage $message): void
{
trigger_deprecation('Chill-project/chill-bundles', '3.7.0', 'Send message using Notifier component');

View File

@@ -23,19 +23,17 @@ use Symfony\Component\Workflow\Registry;
*
* This handler apply a transition if the workflow's configuration defines one.
*/
final readonly class PostPublicViewMessageHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class PostPublicViewMessageHandler
{
private const LOG_PREFIX = '[PostPublicViewMessageHandler] ';
private const TRANSITION_ON_VIEW = 'onExternalView';
public function __construct(
private EntityWorkflowSendViewRepository $sendViewRepository,
private Registry $registry,
private LoggerInterface $logger,
private EntityManagerInterface $entityManager,
) {}
public function __invoke(PostPublicViewMessage $message): void
{
$view = $this->sendViewRepository->find($message->entityWorkflowSendViewId);

View File

@@ -19,14 +19,14 @@ use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
final readonly class PostSendExternalMessageHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class PostSendExternalMessageHandler
{
public function __construct(
private EntityWorkflowRepository $entityWorkflowRepository,
private MailerInterface $mailer,
private EntityWorkflowManager $workflowManager,
) {}
public function __invoke(PostSendExternalMessage $message): void
{
$entityWorkflow = $this->entityWorkflowRepository->find($message->entityWorkflowId);
@@ -39,7 +39,6 @@ final readonly class PostSendExternalMessageHandler implements MessageHandlerInt
$this->sendEmailToDestinee($send, $message);
}
}
private function sendEmailToDestinee(EntityWorkflowSend $send, PostSendExternalMessage $message): void
{
$entityWorkflow = $send->getEntityWorkflowStep()->getEntityWorkflow();

View File

@@ -17,14 +17,14 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
final readonly class PostSignatureStateChangeHandler implements MessageHandlerInterface
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class PostSignatureStateChangeHandler
{
public function __construct(
private EntityWorkflowStepSignatureRepository $entityWorkflowStepSignatureRepository,
private SignatureStepStateChanger $signatureStepStateChanger,
private EntityManagerInterface $entityManager,
) {}
public function __invoke(PostSignatureStateChangeMessage $message): void
{
$signature = $this->entityWorkflowStepSignatureRepository->find($message->signatureId);