| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public static function create(array $dependencyChain): self |
||
| 16 | { |
||
| 17 | $chain = implode(' -> ', $dependencyChain); |
||
| 18 | $message = <<<TXT |
||
| 19 | Circular dependency detected: {$chain} |
||
| 20 | |||
| 21 | This happens when classes depend on each other in a loop. |
||
| 22 | Consider using setter injection or the factory pattern to break the cycle. |
||
| 23 | TXT; |
||
| 24 | return new self($message); |
||
| 25 | } |
||
| 27 |