function EventDataCollector::__construct
Parameters
iterable<EventDispatcherInterface>|EventDispatcherInterface|null $dispatchers:
File
-
vendor/
symfony/ http-kernel/ DataCollector/ EventDataCollector.php, line 38
Class
- EventDataCollector
- @author Fabien Potencier <fabien@symfony.com>
Namespace
Symfony\Component\HttpKernel\DataCollectorCode
public function __construct(iterable|EventDispatcherInterface|null $dispatchers = null, ?RequestStack $requestStack = null, string $defaultDispatcher = 'event_dispatcher') {
if ($dispatchers instanceof EventDispatcherInterface) {
$dispatchers = [
$this->defaultDispatcher => $dispatchers,
];
}
$this->dispatchers = $dispatchers ?? [];
}