src/Core/Framework/MessageQueue/Subscriber/UpdatePostFinishSubscriber.php line 31

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\MessageQueue\Subscriber;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Shopware\Core\Framework\MessageQueue\ScheduledTask\Registry\TaskRegistry;
  5. use Shopware\Core\Framework\Update\Event\UpdatePostFinishEvent;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. /**
  8.  * @internal
  9.  */
  10. #[Package('system-settings')]
  11. final class UpdatePostFinishSubscriber implements EventSubscriberInterface
  12. {
  13.     /**
  14.      * @internal
  15.      */
  16.     public function __construct(private readonly TaskRegistry $registry)
  17.     {
  18.     }
  19.     /**
  20.      * @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
  21.      */
  22.     public static function getSubscribedEvents(): array
  23.     {
  24.         return [UpdatePostFinishEvent::class => 'updatePostFinishEvent'];
  25.     }
  26.     public function updatePostFinishEvent(): void
  27.     {
  28.         $this->registry->registerTasks();
  29.     }
  30. }