| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | private function buildMessage(object|string $caller, string $resolvableType): string |
||
| 15 | { |
||
| 16 | $callerClassInfo = ClassInfo::from($caller, $resolvableType); |
||
| 17 | |||
| 18 | $message = 'ClassResolver Exception' . PHP_EOL; |
||
| 19 | $message .= sprintf( |
||
| 20 | 'Cannot resolve the `%s` for your module `%s`', |
||
| 21 | $resolvableType, |
||
| 22 | $callerClassInfo->getModuleName(), |
||
| 23 | ) . PHP_EOL; |
||
| 24 | |||
| 25 | $message .= sprintf( |
||
| 26 | 'You can fix this by adding the missing `%s` to your module.', |
||
| 27 | $resolvableType, |
||
| 28 | ) . PHP_EOL; |
||
| 29 | |||
| 30 | return $message . (sprintf( |
||
| 31 | 'E.g. `%s`', |
||
| 32 | $this->findClassNameExample($callerClassInfo, $resolvableType), |
||
| 33 | ) . PHP_EOL); |
||
| 34 | } |
||
| 46 |