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