diff --git a/src/Bootloader/TokenizerListenerBootloader.php b/src/Bootloader/TokenizerListenerBootloader.php index e2e109a..28f7a3c 100644 --- a/src/Bootloader/TokenizerListenerBootloader.php +++ b/src/Bootloader/TokenizerListenerBootloader.php @@ -49,9 +49,13 @@ final class TokenizerListenerBootloader extends Bootloader implements /** @var TokenizationListenerInterface[] */ private array $listeners = []; + /** @var array> */ + private array $listenerClasses = []; + public function addListener(TokenizationListenerInterface $listener): void { $this->listeners[] = $listener; + $this->listenerClasses[] = $listener::class; } public function init(AbstractKernel $kernel): void @@ -86,6 +90,14 @@ public function initCachedInterfacesLoader( return $this->makeCachedLoader($factory, $config, CachedInterfacesLoader::class); } + /** + * @return array> + */ + public function getListenerClasses(): array + { + return $this->listenerClasses; + } + /** * @template T * diff --git a/src/TokenizerListenerRegistryInterface.php b/src/TokenizerListenerRegistryInterface.php index 87f4234..74df24d 100644 --- a/src/TokenizerListenerRegistryInterface.php +++ b/src/TokenizerListenerRegistryInterface.php @@ -6,6 +6,7 @@ /** * It contains all listeners that will be noticed about found classes by a class locator. + * @method getListenerClasses(): array */ interface TokenizerListenerRegistryInterface {