Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TraceableEventDispatcher.php

function TraceableEventDispatcher::preProcess

1 call to TraceableEventDispatcher::preProcess()
TraceableEventDispatcher::dispatch in vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
Dispatches an event to all registered listeners.

File

vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php, line 244

Class

TraceableEventDispatcher
Collects some data about event listeners.

Namespace

Symfony\Component\EventDispatcher\Debug

Code

private function preProcess(string $eventName) : void {
    if (!$this->dispatcher
        ->hasListeners($eventName)) {
        $this->orphanedEvents[$this->currentRequestHash][] = $eventName;
        return;
    }
    foreach ($this->dispatcher
        ->getListeners($eventName) as $listener) {
        $priority = $this->getListenerPriority($eventName, $listener);
        $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this);
        $this->wrappedListeners[$eventName][] = $wrappedListener;
        $this->dispatcher
            ->removeListener($eventName, $listener);
        $this->dispatcher
            ->addListener($eventName, $wrappedListener, $priority);
        $this->callStack
            ->attach($wrappedListener, [
            $eventName,
            $this->currentRequestHash,
        ]);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal