| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function __invoke(ContainerInterface $container): ChainToggleStrategyFactory |
||
| 15 | { |
||
| 16 | /** @var SegmentFactory $segmentFactory */ |
||
| 17 | $segmentFactory = $container->get(SegmentFactory::class); |
||
| 18 | /** @var ToggleConfig $toggleConfig */ |
||
| 19 | $toggleConfig = $container->get(ToggleConfig::class); |
||
| 20 | |||
| 21 | return self::create( |
||
| 22 | $segmentFactory, |
||
| 23 | ...array_map( |
||
| 24 | function (array $strategyType) use ($container) { |
||
| 25 | /** @var ToggleStrategyFactory $toggleStrategyFactory */ |
||
| 26 | $toggleStrategyFactory = $container->get($strategyType['type']); |
||
| 27 | |||
| 28 | return $toggleStrategyFactory; |
||
| 29 | }, |
||
| 30 | $toggleConfig->strategyTypes() |
||
| 31 | ) |
||
| 42 |