| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 3 | public function __invoke(ContainerInterface $container): ClaimCheckerManagerFactory |
|
| 19 | { |
||
| 20 | 3 | $config = $container->get('config')[static::MODULE_KEY][static::SERVICE_TYPE_KEY] ?? []; |
|
| 21 | |||
| 22 | 3 | $checkers = $this->getCheckers($container, $config['checkers'] ?? []); |
|
| 23 | |||
| 24 | 3 | $factory = new ClaimCheckerManagerFactory(); |
|
| 25 | |||
| 26 | 3 | foreach ($checkers as $alias => $checker) { |
|
| 27 | 3 | if (! \is_string($alias)) { |
|
| 28 | throw new InvalidArgumentException('Invalid alias for claim checker'); |
||
| 29 | } |
||
| 30 | |||
| 31 | 3 | $factory->add($alias, $checker); |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | return $factory; |
|
| 35 | } |
||
| 60 |