Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

EzPublishCoreCollector.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishDebugBundle\Collector;
8
9 use Symfony\Component\HttpKernel\DataCollector\DataCollector;
10 use Symfony\Component\HttpFoundation\Request;
11 use Symfony\Component\HttpFoundation\Response;
12 use InvalidArgumentException;
13 use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
14
15 class EzPublishCoreCollector extends DataCollector
16 {
17 public function __construct()
18 {
19 $this->reset();
20 }
21
22 public function collect(Request $request, Response $response, \Exception $exception = null)
23 {
25 foreach ($this->data['collectors'] as $innerCollector) {
26 $innerCollector->collect($request, $response, $exception);
27 }
28 }
29
30 public function getName()
31 {
32 return 'ezpublish.debug.toolbar';
33 }
34
38 public function addCollector(DataCollectorInterface $collector, $panelTemplate = null, $toolbarTemplate = null)
39 {
40 $name = $collector->getName();
41 $this->data['collectors'][$name] = $collector;
42 $this->data['panelTemplates'][$name] = $panelTemplate;
43 $this->data['toolbarTemplates'][$name] = $toolbarTemplate;
44 }
45
53 public function getCollector($name)
54 {
55 if (!isset($this->data['collectors'][$name])) {
56 throw new InvalidArgumentException("Invalid debug collector '$name'");
57 }
58
59 return $this->data['collectors'][$name];
60 }
61
65 public function getAllCollectors()
66 {
67 return $this->data['collectors'];
68 }
69
77 public function getToolbarTemplate($collectorName)
78 {
79 if (!isset($this->data['toolbarTemplates'][$collectorName])) {
80 return null;
81 }
82
83 return $this->data['toolbarTemplates'][$collectorName];
84 }
85
93 public function getPanelTemplate($collectorName)
94 {
95 if (!isset($this->data['panelTemplates'][$collectorName])) {
96 return null;
97 }
98
99 return $this->data['panelTemplates'][$collectorName];
100 }
101
105 public function reset()
106 {
107 $this->data = [
108 'collectors' => [],
109 'panelTemplates' => [],
110 'toolbarTemplates' => [],
111 ];
112 }
113 }
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector
Definition: EzPublishCoreCollector.php:16
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\__construct
__construct()
Definition: EzPublishCoreCollector.php:17
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\addCollector
addCollector(DataCollectorInterface $collector, $panelTemplate=null, $toolbarTemplate=null)
Definition: EzPublishCoreCollector.php:38
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\getCollector
getCollector($name)
Definition: EzPublishCoreCollector.php:53
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\reset
reset()
{}
Definition: EzPublishCoreCollector.php:105
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\getName
getName()
Definition: EzPublishCoreCollector.php:30
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\getToolbarTemplate
getToolbarTemplate($collectorName)
Returns toolbar template for given collector name.
Definition: EzPublishCoreCollector.php:77
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\getPanelTemplate
getPanelTemplate($collectorName)
Returns panel template to use for given collector name.
Definition: EzPublishCoreCollector.php:93
eZ\Bundle\EzPublishDebugBundle\Collector\EzPublishCoreCollector\getAllCollectors
getAllCollectors()
Definition: EzPublishCoreCollector.php:65
eZ\Bundle\EzPublishDebugBundle\Collector
Definition: EzPublishCoreCollector.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.