Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -30,25 +30,21 @@ use Symfony\Contracts\Service\ResetInterface;
*/
class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface
{
protected ?LoggerInterface $logger;
protected Stopwatch $stopwatch;
/**
* @var \SplObjectStorage<WrappedListener, array{string, string}>|null
*/
private ?\SplObjectStorage $callStack = null;
private EventDispatcherInterface $dispatcher;
private array $wrappedListeners = [];
private array $orphanedEvents = [];
private ?RequestStack $requestStack;
private string $currentRequestHash = '';
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null)
{
$this->dispatcher = $dispatcher;
$this->stopwatch = $stopwatch;
$this->logger = $logger;
$this->requestStack = $requestStack;
public function __construct(
private EventDispatcherInterface $dispatcher,
protected Stopwatch $stopwatch,
protected ?LoggerInterface $logger = null,
private ?RequestStack $requestStack = null,
protected readonly ?\Closure $disabled = null,
) {
}
public function addListener(string $eventName, callable|array $listener, int $priority = 0): void
@@ -108,6 +104,9 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
public function dispatch(object $event, ?string $eventName = null): object
{
if ($this->disabled?->__invoke()) {
return $this->dispatcher->dispatch($event, $eventName);
}
$eventName ??= $event::class;
$this->callStack ??= new \SplObjectStorage();
@@ -115,7 +114,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
$currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
$this->logger->debug(\sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
}
$this->preProcess($eventName);