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

Breadcrumb

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

function DirectDispatcher::dispatch

Throws

Throwable

UnknownEventTypeException

Overrides Dispatcher::dispatch

File

vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php, line 76

Class

DirectDispatcher
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Event

Code

public function dispatch(Event $event) : void {
    $eventClassName = $event::class;
    if (!$this->typeMap
        ->isKnownEventType($event)) {
        throw new UnknownEventTypeException(sprintf('Unknown event type "%s"', $eventClassName));
    }
    foreach ($this->tracers as $tracer) {
        try {
            $tracer->trace($event);
            // @codeCoverageIgnoreStart
        } catch (Throwable $t) {
            $this->handleThrowable($t);
        }
        // @codeCoverageIgnoreEnd
    }
    if (!array_key_exists($eventClassName, $this->subscribers)) {
        return;
    }
    foreach ($this->subscribers[$eventClassName] as $subscriber) {
        try {
            $subscriber->notify($event);
        } catch (Throwable $t) {
            $this->handleThrowable($t);
        }
    }
}
RSS feed
Powered by Drupal