1 | <?php |
||
24 | class Debugger implements |
||
25 | DebuggerInterface, |
||
26 | DebuggerBarInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var DebuggerOptions |
||
30 | */ |
||
31 | private $options; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $barPanels = []; |
||
37 | |||
38 | /** |
||
39 | * @var \WebinoDebug\Debugger\DebuggerTimer |
||
40 | */ |
||
41 | protected $timerPrototype; |
||
42 | |||
43 | /** |
||
44 | * @param array|DebuggerOptions $options |
||
45 | */ |
||
46 | public function __construct($options = null) |
||
81 | |||
82 | /** |
||
83 | * @return DebuggerOptions |
||
84 | */ |
||
85 | public function getOptions() |
||
89 | |||
90 | /** |
||
91 | * @return PanelInterface[] |
||
92 | */ |
||
93 | public function getBarPanels() |
||
97 | |||
98 | /** |
||
99 | * @param string $id |
||
100 | * @return PanelInterface|null |
||
101 | */ |
||
102 | public function getBarPanel($id) |
||
108 | |||
109 | /** |
||
110 | * Set debugger bar panel |
||
111 | * |
||
112 | * @param object|PanelInterface|null $panel Panel object |
||
113 | * @param string $id Panel id |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function setBarPanel(PanelInterface $panel = null, $id = null) |
||
121 | |||
122 | /** |
||
123 | * Set debugger bar info |
||
124 | * |
||
125 | * @param string $label Info label |
||
126 | * @param string|int $value Info value |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function setBarInfo(string $label, $value) |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function dump($subject) |
||
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | public function timer($name = null) |
||
152 | |||
153 | /** |
||
154 | * @return DebuggerTimer |
||
155 | */ |
||
156 | private function createDebuggerTimer() |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | * @deprecated use dump() instead, now it returns stringable object |
||
169 | */ |
||
170 | public function dumpStr($subject) |
||
174 | |||
175 | /** |
||
176 | * {@inheritdoc} |
||
177 | * @deprecated use dump() instead, now it returns object |
||
178 | */ |
||
179 | public function barDump($subject, $title = null, array $options = null) |
||
183 | } |
||
184 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: