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