We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 045a5ba commit 497f73aCopy full SHA for 497f73a
Debug/TraceableEventDispatcher.php
@@ -43,6 +43,7 @@ public function __construct(
43
protected Stopwatch $stopwatch,
44
protected ?LoggerInterface $logger = null,
45
private ?RequestStack $requestStack = null,
46
+ protected readonly ?\Closure $disabled = null,
47
) {
48
}
49
@@ -103,6 +104,9 @@ public function hasListeners(?string $eventName = null): bool
103
104
105
public function dispatch(object $event, ?string $eventName = null): object
106
{
107
+ if ($this->disabled?->__invoke()) {
108
+ return $this->dispatcher->dispatch($event, $eventName);
109
+ }
110
$eventName ??= $event::class;
111
112
$this->callStack ??= new \SplObjectStorage();
0 commit comments