From 51ce6edf61271da74eee759d0ee4ce2c013260c7 Mon Sep 17 00:00:00 2001 From: Matthijs van den Bos Date: Sun, 1 Feb 2026 15:08:43 +0100 Subject: [PATCH] Fix DispatcherTrait formatting --- src/Downloader/Downloader.php | 11 ----------- src/Event/DispatcherTrait.php | 11 +++++++++++ src/Spider.php | 11 ----------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Downloader/Downloader.php b/src/Downloader/Downloader.php index b30efd1..3de8307 100644 --- a/src/Downloader/Downloader.php +++ b/src/Downloader/Downloader.php @@ -103,17 +103,6 @@ public function isDownLoadLimitExceeded(): bool return $this->getDownloadLimit() !== 0 && $this->getPersistenceHandler()->count() >= $this->getDownloadLimit(); } - /** - * A shortcut for EventDispatcher::dispatch() - * - * @param GenericEvent $event - * @param string $eventName - */ - private function dispatch(GenericEvent $event, string $eventName): void - { - $this->getDispatcher()->dispatch($event, $eventName); - } - /** * @param DiscoveredUri $uri * @return Resource|false diff --git a/src/Event/DispatcherTrait.php b/src/Event/DispatcherTrait.php index 4a149f1..3b14b47 100644 --- a/src/Event/DispatcherTrait.php +++ b/src/Event/DispatcherTrait.php @@ -21,4 +21,15 @@ public function getDispatcher(): EventDispatcherInterface return $this->dispatcher; } + + /** + * A shortcut for EventDispatcher::dispatch() + * + * @param object $event + * @param string $eventName + */ + protected function dispatch(object $event, string $eventName): void + { + $this->getDispatcher()->dispatch($event, $eventName); + } } diff --git a/src/Spider.php b/src/Spider.php index d0ab611..ada2729 100644 --- a/src/Spider.php +++ b/src/Spider.php @@ -142,17 +142,6 @@ public function setDownloader(DownloaderInterface $downloader): Spider return $this; } - /** - * A shortcut for EventDispatcher::dispatch() - * - * @param GenericEvent $event - * @param string $eventName - */ - private function dispatch(GenericEvent $event, string $eventName): void - { - $this->getDispatcher()->dispatch($event, $eventName); - } - /** * Function that crawls each provided URI * It applies all processors and listeners set on the Spider