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