-
-
Notifications
You must be signed in to change notification settings - Fork 221
Expand file tree
/
Copy pathsection-stack-exception.phtml
More file actions
40 lines (34 loc) · 1.03 KB
/
section-stack-exception.phtml
File metadata and controls
40 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace Tracy;
/**
* @var \Throwable $ex
* @var callable $dump
* @var BlueScreen $this
*/
$stack = $ex->getTrace();
$expanded = null;
if (
(!$ex instanceof \ErrorException
|| in_array($ex->getSeverity(), [E_USER_NOTICE, E_USER_WARNING, E_USER_DEPRECATED], true))
&& $this->isCollapsed($ex->getFile())
) {
foreach ($stack as $key => $row) {
if (isset($row['file']) && !$this->isCollapsed($row['file'])) {
$expanded = $key;
break;
}
}
}
if (in_array($stack[0]['class'] ?? null, [DevelopmentStrategy::class, ProductionStrategy::class], true)) {
array_shift($stack);
}
if (($stack[0]['class'] ?? null) === Debugger::class && in_array($stack[0]['function'], ['shutdownHandler', 'errorHandler'], true)) {
array_shift($stack);
}
$file = $ex->getFile();
$line = $ex->getLine();
[$realArgs, $variables] = $this->getRealArgsAndVariables($ex);
require __DIR__ . '/section-stack-sourceFile.phtml';
require __DIR__ . '/section-stack-variables.phtml';
require __DIR__ . '/section-stack-callStack.phtml';