|
1 | | -<?php $error_id = uniqid('error', true); ?> |
| 1 | +<?php |
| 2 | +use Config\Services; |
| 3 | +use CodeIgniter\CodeIgniter; |
| 4 | + |
| 5 | +$errorId = uniqid('error', true); |
| 6 | +?> |
2 | 7 | <!doctype html> |
3 | 8 | <html> |
4 | 9 | <head> |
|
77 | 82 | <?php if (isset($row['class'])) : ?> |
78 | 83 | — <?= esc($row['class'] . $row['type'] . $row['function']) ?> |
79 | 84 | <?php if (! empty($row['args'])) : ?> |
80 | | - <?php $args_id = $error_id . 'args' . $index ?> |
81 | | - ( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> ) |
82 | | - <div class="args" id="<?= esc($args_id, 'attr') ?>"> |
| 85 | + <?php $argsId = $errorId . 'args' . $index ?> |
| 86 | + ( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> ) |
| 87 | + <div class="args" id="<?= esc($argsId, 'attr') ?>"> |
83 | 88 | <table cellspacing="0"> |
84 | 89 |
|
85 | 90 | <?php |
86 | 91 | $params = null; |
87 | 92 | // Reflection by name is not available for closure function |
88 | 93 | if (substr($row['function'], -1) !== '}') { |
89 | | - $mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']); |
| 94 | + $mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']); |
90 | 95 | $params = $mirror->getParameters(); |
91 | 96 | } |
92 | 97 |
|
|
189 | 194 |
|
190 | 195 | <!-- Request --> |
191 | 196 | <div class="content" id="request"> |
192 | | - <?php $request = \Config\Services::request(); ?> |
| 197 | + <?php $request = Services::request(); ?> |
193 | 198 |
|
194 | 199 | <table> |
195 | 200 | <tbody> |
|
283 | 288 | </tr> |
284 | 289 | </thead> |
285 | 290 | <tbody> |
286 | | - <?php foreach ($headers as $value) : ?> |
287 | | - <?php |
288 | | - if (empty($value)) { |
289 | | - continue; |
290 | | - } |
291 | | - |
292 | | - if (! is_array($value)) { |
293 | | - $value = [$value]; |
294 | | - } ?> |
295 | | - <?php foreach ($value as $h) : ?> |
296 | | - <tr> |
297 | | - <td><?= esc($h->getName(), 'html') ?></td> |
298 | | - <td><?= esc($h->getValueLine(), 'html') ?></td> |
299 | | - </tr> |
300 | | - <?php endforeach; ?> |
| 291 | + <?php foreach ($headers as $header) : ?> |
| 292 | + <tr> |
| 293 | + <td><?= esc($header->getName(), 'html') ?></td> |
| 294 | + <td><?= esc($header->getValueLine(), 'html') ?></td> |
| 295 | + </tr> |
301 | 296 | <?php endforeach; ?> |
302 | 297 | </tbody> |
303 | 298 | </table> |
|
307 | 302 |
|
308 | 303 | <!-- Response --> |
309 | 304 | <?php |
310 | | - $response = \Config\Services::response(); |
| 305 | + $response = Services::response(); |
311 | 306 | $response->setStatusCode(http_response_code()); |
312 | 307 | ?> |
313 | 308 | <div class="content" id="response"> |
|
332 | 327 | </tr> |
333 | 328 | </thead> |
334 | 329 | <tbody> |
335 | | - <?php foreach ($headers as $name => $value) : ?> |
| 330 | + <?php foreach (array_keys($headers) as $name) : ?> |
336 | 331 | <tr> |
337 | 332 | <td><?= esc($name, 'html') ?></td> |
338 | 333 | <td><?= esc($response->getHeaderLine($name), 'html') ?></td> |
|
387 | 382 | <p> |
388 | 383 | Displayed at <?= esc(date('H:i:sa')) ?> — |
389 | 384 | PHP: <?= esc(PHP_VERSION) ?> — |
390 | | - CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?> |
| 385 | + CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> |
391 | 386 | </p> |
392 | 387 |
|
393 | 388 | </div> |
|
0 commit comments