| Conditions | 6 |
| Paths | 18 |
| Total Lines | 34 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public static function getExceptionTraceAsString(Exception $exception) |
||
| 24 | { |
||
| 25 | $errorString = "#00 User: "; |
||
| 26 | |||
| 27 | /** @var User|null $user */ |
||
| 28 | $user = Auth::user(); |
||
| 29 | |||
| 30 | if ($user) { |
||
|
|
|||
| 31 | $errorString .= $user->id . ' ' . $user->name; |
||
| 32 | } |
||
| 33 | |||
| 34 | $errorString .= "\n"; |
||
| 35 | $count = 0; |
||
| 36 | |||
| 37 | foreach ($exception->getTrace() as $frame) { |
||
| 38 | $args = ""; |
||
| 39 | |||
| 40 | if (isset($frame['args'])) { |
||
| 41 | $args = self::getFrameArgs($frame['args']); |
||
| 42 | } |
||
| 43 | |||
| 44 | $currentFile = isset($frame['file']) ? $frame['file'] : '[internal function]'; |
||
| 45 | $currentLine = isset($frame['line']) ? $frame['line'] : ''; |
||
| 46 | |||
| 47 | $errorString .= sprintf("#%s %s(%s): %s(%s)\n", |
||
| 48 | $count, |
||
| 49 | $currentFile, |
||
| 50 | $currentLine, |
||
| 51 | $frame['function'], |
||
| 52 | $args); |
||
| 53 | $count++; |
||
| 54 | } |
||
| 55 | |||
| 56 | return $errorString . "\n"; |
||
| 57 | } |
||
| 91 |