| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 63 | 4 | public static function createHere($message, array $context = []) |
|
| 64 | { |
||
| 65 | 4 | foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2) as $trace) { |
|
| 66 | // File is not set if we call from an anonymous context like an array_map function. |
||
| 67 | 4 | if (isset($trace['file'])) { |
|
| 68 | 4 | break; |
|
| 69 | } |
||
| 70 | } |
||
| 71 | |||
| 72 | 4 | return new self($message, $trace['file'], $trace['line'], $context); |
|
|
|
|||
| 73 | } |
||
| 74 | |||
| 107 |
It seems like you are relying on a variable being defined by an iteration: