| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 3 | public static function mapNotFoundForClassName(string $className, array $suggestions = []): self |
|
| 18 | { |
||
| 19 | 3 | $message = <<<TXT |
|
| 20 | 3 | No concrete class was found that implements: |
|
| 21 | 3 | "{$className}" |
|
| 22 | Did you forget to bind this interface to a concrete class? |
||
| 23 | |||
| 24 | 3 | TXT; |
|
| 25 | |||
| 26 | 3 | if (count($suggestions) > 0) { |
|
| 27 | 1 | $message .= "\nDid you mean one of these?\n"; |
|
| 28 | 1 | foreach ($suggestions as $suggestion) { |
|
| 29 | 1 | $message .= " - {$suggestion}\n"; |
|
| 30 | } |
||
| 31 | 1 | $message .= "\n"; |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | $message .= 'You might find some help here: https://gacela-project.com/docs/bootstrap/#bindings'; |
|
| 35 | |||
| 36 | 3 | return new self($message); |
|
| 37 | } |
||
| 39 |