| 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(JWAManagerFactory::class)) { |
||
| 27 | return; |
||
| 28 | } |
||
| 29 | |||
| 30 | $definition = $container->getDefinition(JWAManagerFactory::class); |
||
| 31 | |||
| 32 | $taggedAlgorithmServices = $container->findTaggedServiceIds('jose.algorithm'); |
||
| 33 | foreach ($taggedAlgorithmServices as $id => $tags) { |
||
| 34 | foreach ($tags as $attributes) { |
||
| 35 | if (!array_key_exists('alias', $attributes)) { |
||
| 36 | throw new \InvalidArgumentException(sprintf("The algorithm '%s' does not have any 'alias' attribute.", $id)); |
||
| 37 | } |
||
| 38 | $definition->addMethodCall('add', [$attributes['alias'], new Reference($id)]); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |