Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | 2 | public function __invoke( |
|
21 | ContainerInterface $container, |
||
22 | string $contextName = ConfigProvider::DEFAULT_CONTEXT |
||
23 | ): ActionContainer { |
||
24 | 2 | $contextConfig = ConfigProvider::getContextConfig($contextName, $container->get(ConfigProvider::CONFIG_KEY)); |
|
25 | 1 | foreach ($contextConfig[ConfigProvider::MESSAGE_TYPES_KEY] ?? [] as $messageType => $action) { |
|
26 | 1 | $actions[$messageType] = static fn() => $container->get($action); |
|
27 | } |
||
28 | |||
29 | 1 | return new ActionContainer($actions ?? []); |
|
30 | } |
||
32 |