Conditions | 5 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 5 |
Changes | 3 | ||
Bugs | 0 | Features | 3 |
1 | <?php |
||
44 | 1 | protected static function getDebug(Exception $exception, $depth = -1) |
|
45 | { |
||
46 | 1 | $errorDebugMsg = sprintf( |
|
47 | 1 | "ERROR CLASS:%s\nERROR CODE:%d\nERROR FILE:%s\nERROR MESSAGE:%s\nERROR TRACE:\n%s", |
|
48 | 1 | get_class($exception), |
|
49 | 1 | $exception->getCode(), |
|
50 | 1 | $exception->getFile(), |
|
51 | 1 | $exception->getMessage(), |
|
52 | 1 | $exception->getTraceAsString() |
|
53 | 1 | ); |
|
54 | |||
55 | 1 | if (($depth == -1 || $depth > 0) && $exception->getPrevious() instanceof Exception) { |
|
56 | 1 | $depth -= $depth > 0 ? 1 : 0; |
|
57 | 1 | $errorDebugMsg = sprintf( |
|
58 | 1 | "%s\n\nPRIVIOUS EXCEPTION:\n%s", |
|
59 | 1 | $errorDebugMsg, |
|
60 | 1 | static::getDebug($exception->getPrevious(), $depth) |
|
61 | 1 | ); |
|
62 | 1 | } |
|
63 | |||
64 | 1 | return $errorDebugMsg; |
|
65 | } |
||
66 | } |
||
67 |