diff --git a/src/AutoSubscriber.php b/src/AutoSubscriber.php index a5ff85b..990c5ac 100644 --- a/src/AutoSubscriber.php +++ b/src/AutoSubscriber.php @@ -16,7 +16,7 @@ public function subscribe(Dispatcher $dispatcher): void ->except($exclude) ->each(function (array $events, string $handler) use ($dispatcher) { foreach ($events as $event) { - $dispatcher->listen($event, [$this, $handler]); + $dispatcher->listen($event, [static::class, $handler]); } }); } diff --git a/tests/DispatcherFake.php b/tests/DispatcherFake.php index d4e4362..30c6f4c 100644 --- a/tests/DispatcherFake.php +++ b/tests/DispatcherFake.php @@ -18,7 +18,7 @@ public function listen($events, $listener = null) $this->listeners[] = [ 'event' => $events, - 'subscriber' => get_class($subscriber), + 'subscriber' => $subscriber, 'handler' => $handler, ]; }