diff --git a/queue_stats.info.yml b/queue_stats.info.yml index cc2a7813e38a9cedd0a8c6b05ae72aa73d313329..c21bca91d4f3212f1b88d140a319ae53b5c08798 100644 --- a/queue_stats.info.yml +++ b/queue_stats.info.yml @@ -1,6 +1,6 @@ name: 'Queue Statistics' type: module description: 'Calculate statistics about queues' -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8 || ^9 || ^10 package: 'Queues' configure: 'queue_stats.admin_form' diff --git a/src/Event/QueueItemEvent.php b/src/Event/QueueItemEvent.php index a7920f5220ad9cea0b917c823b5e2035697a3ce1..2261c78745b74d178e21d5d5f8b0cbc1773b34d5 100644 --- a/src/Event/QueueItemEvent.php +++ b/src/Event/QueueItemEvent.php @@ -2,8 +2,8 @@ namespace Drupal\queue_stats\Event; +use Symfony\Contracts\EventDispatcher\Event; use Drupal\queue_stats\MonitoredQueueInterface; -use Symfony\Component\EventDispatcher\Event; /** * Queue item event class. diff --git a/src/MonitoredQueue.php b/src/MonitoredQueue.php index 3df5f7a9c9e42d68bbfcbcd5247b75851ec6f4fa..27296aff16fec778cff926a630869a4ca8b688b2 100644 --- a/src/MonitoredQueue.php +++ b/src/MonitoredQueue.php @@ -70,7 +70,7 @@ class MonitoredQueue implements MonitoredQueueInterface, QueueInterface, QueueGa */ public function deleteItem($item) { $event = new QueueItemEvent(QueueItemEvent::PROCESSING_COMPLETED, $this, $item, $this->time->getCurrentMicroTime()); - $this->dispatcher->dispatch($event->getName(), $event); + $this->dispatcher->dispatch($event, $event->getName()); $this->queue->deleteItem($item); } @@ -82,7 +82,7 @@ class MonitoredQueue implements MonitoredQueueInterface, QueueInterface, QueueGa $item = $this->queue->claimItem($lease_time); if ($item !== FALSE) { $event = new QueueItemEvent(QueueItemEvent::PROCESSING_STARTED, $this, $item, $this->time->getCurrentMicroTime()); - $this->dispatcher->dispatch($event->getName(), $event); + $this->dispatcher->dispatch($event, $event->getName()); } return $item; } @@ -108,7 +108,7 @@ class MonitoredQueue implements MonitoredQueueInterface, QueueInterface, QueueGa $released = $this->queue->releaseItem($item); if ($released) { $event = new QueueItemEvent(QueueItemEvent::PROCESSING_ABORTED, $this, $item, $this->time->getCurrentMicroTime()); - $this->dispatcher->dispatch($event->getName(), $event); + $this->dispatcher->dispatch($event, $event->getName()); } return $released; } diff --git a/src/Plugin/QueueStatisticManager.php b/src/Plugin/QueueStatisticManager.php index 5943031f509cf51c875fdccf3294b42419c68658..c33fdf18ae45d8b380b3c785679709cc6ea283b7 100644 --- a/src/Plugin/QueueStatisticManager.php +++ b/src/Plugin/QueueStatisticManager.php @@ -119,7 +119,7 @@ class QueueStatisticManager extends DefaultPluginManager implements EventSubscri * Queue event. */ public function onEvent(QueueItemEvent $event) { - $this->eventDispatcher->dispatch($event->getName(), $event); + $this->eventDispatcher->dispatch($event, $event->getName()); } /**