public function __construct(EventDispatcherInterface $dispatcher = null)
{
+ if ($dispatcher instanceof TraceableEventDispatcherInterface && !method_exists($dispatcher, 'reset')) {
+ @trigger_error(sprintf('Implementing "%s" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "%s".', TraceableEventDispatcherInterface::class, \get_class($dispatcher)), E_USER_DEPRECATED);
+ }
$this->dispatcher = $dispatcher;
}
);
}
+ public function reset()
+ {
+ $this->data = array();
+
+ if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
+ if (!method_exists($this->dispatcher, 'reset')) {
+ return; // @deprecated
+ }
+
+ $this->dispatcher->reset();
+ }
+ }
+
public function lateCollect()
{
if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
$this->setCalledListeners($this->dispatcher->getCalledListeners());
$this->setNotCalledListeners($this->dispatcher->getNotCalledListeners());
}
+ $this->data = $this->cloneVar($this->data);
}
/**