Skip to content

Commit

Permalink
Bind to handler class name instead of instance to fix ShouldQueue issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rojtjo committed Dec 4, 2023
1 parent 7e28038 commit 6864050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AutoSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/DispatcherFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function listen($events, $listener = null)

$this->listeners[] = [
'event' => $events,
'subscriber' => get_class($subscriber),
'subscriber' => $subscriber,
'handler' => $handler,
];
}
Expand Down

0 comments on commit 6864050

Please sign in to comment.