我想收集订阅者事件中的数据,然后将其输出到collect function()。
class MyDataCollector extends DataCollector implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
EventTypes::LOAD => 'providerLoad',
....
}
public static function create(EventDispatcherInterface $eventDispatcher)
{
$collector = new static();
$eventDispatcher->addSubscriber($collector);
return $collector;
}
}