| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 13 | public static function createWidget($config): Widget |
|
| 38 | { |
||
| 39 | 13 | if (self::$factory === null) { |
|
| 40 | 1 | throw new \RuntimeException('Widget factory should be initialized with WidgetFactory::initialize() call.'); |
|
| 41 | } |
||
| 42 | |||
| 43 | /** @psalm-suppress LessSpecificReturnStatement */ |
||
| 44 | 12 | return self::$factory->create($config); |
|
| 45 | } |
||
| 47 |