Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
38 | 4 | public static function createHere(string $message, array $context = []): self |
|
39 | { |
||
40 | 4 | foreach (debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2) as $trace) { |
|
41 | // File is not set if we call from an anonymous context like an array_map function. |
||
42 | 4 | if (isset($trace['file'])) { |
|
43 | 4 | break; |
|
44 | } |
||
45 | } |
||
46 | |||
47 | 4 | return new self($message, $trace['file'], $trace['line'], $context); |
|
|
|||
48 | } |
||
49 | |||
70 |
It seems like you are relying on a variable being defined by an iteration: