class CollectingDispatcher
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@internal This class is not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Event\CollectingDispatcher implements \PHPUnit\Event\Dispatcher
Expanded class hierarchy of CollectingDispatcher
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Dispatcher/ CollectingDispatcher.php, line 17
Namespace
PHPUnit\EventView source
final class CollectingDispatcher implements Dispatcher {
private EventCollection $events;
public function __construct() {
$this->events = new EventCollection();
}
public function dispatch(Event $event) : void {
$this->events
->add($event);
}
public function flush() : EventCollection {
$events = $this->events;
$this->events = new EventCollection();
return $events;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
CollectingDispatcher::$events | private | property | ||
CollectingDispatcher::dispatch | public | function | Overrides Dispatcher::dispatch | |
CollectingDispatcher::flush | public | function | ||
CollectingDispatcher::__construct | public | function |