| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | 6 | public function process(ContainerBuilder $container) |
|
| 25 | { |
||
| 26 | 6 | $cacheDefinition = $container->findDefinition('cache.app'); |
|
| 27 | 6 | $widgetFactoryDefinition = $container->findDefinition(WidgetFactory::class); |
|
| 28 | |||
| 29 | 6 | if (!$cacheDefinition && !$widgetFactoryDefinition) { |
|
|
|
|||
| 30 | 1 | return; |
|
| 31 | } |
||
| 32 | |||
| 33 | $container |
||
| 34 | 5 | ->register(CacheableWidget::class, CacheableWidget::class) |
|
| 35 | 5 | ->addArgument($cacheDefinition) |
|
| 36 | 5 | ->addTag('sauls_widget.widget') |
|
| 37 | 5 | ->addMethodCall('setWidgetFactory', [$widgetFactoryDefinition]) |
|
| 38 | 5 | ->setPublic(true); |
|
| 39 | 5 | } |
|
| 41 |