* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\DataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; /** * EventDataCollector. * * @author Fabien Potencier */ class EventDataCollector extends DataCollector implements LateDataCollectorInterface { protected $dispatcher; 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; } /** * {@inheritdoc} */ public function collect(Request $request, Response $response, \Exception $exception = null) { $this->data = array( 'called_listeners' => array(), 'not_called_listeners' => array(), ); } 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); } /** * Sets the called listeners. * * @param array $listeners An array of called listeners * * @see TraceableEventDispatcherInterface */ public function setCalledListeners(array $listeners) { $this->data['called_listeners'] = $listeners; } /** * Gets the called listeners. * * @return array An array of called listeners * * @see TraceableEventDispatcherInterface */ public function getCalledListeners() { return $this->data['called_listeners']; } /** * Sets the not called listeners. * * @param array $listeners An array of not called listeners * * @see TraceableEventDispatcherInterface */ public function setNotCalledListeners(array $listeners) { $this->data['not_called_listeners'] = $listeners; } /** * Gets the not called listeners. * * @return array An array of not called listeners * * @see TraceableEventDispatcherInterface */ public function getNotCalledListeners() { return $this->data['not_called_listeners']; } /** * {@inheritdoc} */ public function getName() { return 'events'; } } __halt_compiler();----SIGNATURE:----QL3d/NnaEtdegUYP2S/27nlekUEsbEGNuvLujFgQfDwoa1OTReDMf11myZ9JEzdbylBXA+I38rHf7SbCc+4+L/2UoH+nxL6GY5fPFrHsrOJQPIVRQj6APBuPoG4s2QcfBT7TBV58KHhGVgK0Fg8Udb/5NtjROwwia3KL1YU3/ozEQVFtDjhszDywnxnrXHquFSgtoRq27G5bQJFpHlAhZ6XyPrvqDGkEjWv526y8eShXrazG2HMJCpBqLCSHYnAiEvAxzvmDAH6eWQ8NbJK1GQscDmIgbRbdipmRamG+I7ffdMJWYu9qWmSho5gTQgKs1rF59wk//c9tQzVhdBBt9Y32BzW7WYfmEaArcyOhYUTeKwIebfFj5xMtq9YKEgd/lrU+UKQZSQV25DCAUX6Ew4O6DVuEwDdN4ajrPMEtuOd/imyHUOaNx15Tgitbdmi2HRmvfT7CQ2S75McQA82f0G7Xp3ojOsSoYMhfxE+uXf7jye64U8dCqHhxtNwXe+6qm5Y/3tE55u17iKLwrNt6DwlYHpl1/RV515/yTawurjT6YBUfVzosGdBgJiS8j/LjVG6IyZVwn3cQjwqsM3tZRlEOkOXfxsQoSoL3772djZeO4KuPHBEwYRhyW6nY5X+S/iwehGQvXMEKOaybI9vcFoUnPud8x0mcp0Xc5+9o/98=----ATTACHMENT:----MzE2NjQ4Nzc4NzM0NjQxNSA0MDYxMzk1ODk4ODMxMjEwIDQwNzQxMjg5MDg0MTYwNzk=