| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function __invoke(ContainerInterface $container): SimpleAdapter |
||
| 12 | { |
||
| 13 | $config = []; |
||
| 14 | if ($container->has('config')) { |
||
| 15 | $globalConfig = $container->get('config'); |
||
| 16 | assert(is_array($globalConfig)); |
||
| 17 | $middlewareConfig = $globalConfig[HtmlMinifierMiddleware::class] ?? []; |
||
| 18 | assert(is_array($middlewareConfig)); |
||
| 19 | $adapterConfig = $middlewareConfig[SimpleAdapter::class] ?? []; |
||
| 20 | assert(is_array($adapterConfig)); |
||
| 21 | $config = $adapterConfig; |
||
| 22 | } |
||
| 23 | |||
| 24 | $adapter = new SimpleAdapter(); |
||
| 25 | |||
| 26 | if ((is_countable($config) ? count($config) : 0) > 0) { |
||
| 27 | $adapter->setConfig($config); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $adapter; |
||
| 31 | } |
||
| 33 |