| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class NotInstantiableClassException extends Exception implements ContainerExceptionInterface, FriendlyExceptionInterface |
||
| 14 | { |
||
| 15 | #[Pure] |
||
| 16 | public function __construct(string $class, string $message = null, int $code = 0, Exception $previous = null) |
||
| 17 | { |
||
| 18 | if ($message === null) { |
||
| 19 | $message = sprintf( |
||
| 20 | 'Can not instantiate "%s" because it is not a subclass of "%s".', |
||
| 21 | $class, |
||
| 22 | RepositoryInterface::class |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | parent::__construct($message, $code, $previous); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getSolution(): ?string |
||
| 29 | { |
||
| 30 | return 'Make sure that the class is instantiable and implements ' . RepositoryInterface::class; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getName(): string |
||
| 36 | } |
||
| 37 | } |
||
| 38 |