for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yiisoft\EventDispatcher\Dispatcher;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\EventDispatcher\StoppableEventInterface;
final class CompositeDispatcher implements EventDispatcherInterface
{
/**
* @var EventDispatcherInterface[]
*/
private array $dispatchers = [];
public function dispatch(object $event)
foreach ($this->dispatchers as $dispatcher) {
if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
return $event;
}
$event = $dispatcher->dispatch($event);
public function attach(EventDispatcherInterface $dispatcher): void
$this->dispatchers[] = $dispatcher;