Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function process(ContainerBuilder $container) |
||
25 | { |
||
26 | if (!$container->hasDefinition(HeaderCheckerManagerFactory::class)) { |
||
27 | return; |
||
28 | } |
||
29 | |||
30 | $definition = $container->getDefinition(HeaderCheckerManagerFactory::class); |
||
31 | |||
32 | $taggedHeaderCheckerServices = $container->findTaggedServiceIds('jose.checker.header'); |
||
33 | foreach ($taggedHeaderCheckerServices as $id => $tags) { |
||
34 | foreach ($tags as $attributes) { |
||
35 | if (!array_key_exists('alias', $attributes)) { |
||
36 | throw new \InvalidArgumentException(sprintf("The header checker '%s' does not have any 'alias' attribute.", $id)); |
||
37 | } |
||
38 | $definition->addMethodCall('add', [$attributes['alias'], new Reference($id)]); |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 |