| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 5.024 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | 6 | public function __invoke(ContainerInterface $container): TrailingSlashMiddleware |
|
| 11 | { |
||
| 12 | 6 | $config = []; |
|
| 13 | 6 | if ($container->has('config')) { |
|
| 14 | $config = $container->get('config'); |
||
| 15 | assert(is_array($config)); |
||
| 16 | $config = $config[TrailingSlashMiddleware::class]; |
||
| 17 | } |
||
| 18 | |||
| 19 | 6 | $middleware = new TrailingSlashMiddleware(); |
|
| 20 | |||
| 21 | 6 | if ((is_countable($config) ? count($config) : 0) > 0) { |
|
| 22 | $middleware->setConfig($config); |
||
| 23 | } |
||
| 24 | |||
| 25 | 6 | return $middleware; |
|
| 26 | } |
||
| 28 |