| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class NotInstantiableWithoutWidgetFactoryInitializationException |
||
| 12 | extends NotInstantiableException |
||
| 13 | implements FriendlyExceptionInterface |
||
| 14 | { |
||
| 15 | 1 | public function __construct(private ?Throwable $previous) |
|
| 16 | { |
||
| 17 | 1 | parent::__construct( |
|
| 18 | 1 | $previous->getMessage() . |
|
|
|
|||
| 19 | 1 | ' Perhaps need initialize "WidgetFactory" with container for resolve dependencies.', |
|
| 20 | 1 | previous: $previous, |
|
| 21 | 1 | ); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function getName(): string |
|
| 25 | { |
||
| 26 | 1 | return 'Failed to create a widget. ' . $this->previous->getMessage(); |
|
| 27 | } |
||
| 28 | |||
| 29 | public function getSolution(): ?string |
||
| 32 | Perhaps need initialize `WidgetFactory` with container for resolve dependencies. |
||
| 33 | |||
| 34 | To initialize the widget factory call `WidgetFactory::initialize()` before using the widget. |
||
| 62 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.