| @@ 18-33 (lines=16) @@ | ||
| 15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
| 16 | use Symfony\Component\DependencyInjection\Reference; |
|
| 17 | ||
| 18 | final class AlgorithmCompilerPass implements CompilerPassInterface |
|
| 19 | { |
|
| 20 | public function process(ContainerBuilder $container) |
|
| 21 | { |
|
| 22 | if (!$container->hasDefinition('jose.algorithm_manager')) { |
|
| 23 | return; |
|
| 24 | } |
|
| 25 | ||
| 26 | $definition = $container->getDefinition('jose.algorithm_manager'); |
|
| 27 | ||
| 28 | $taggedServices = $container->findTaggedServiceIds('jose.algorithm'); |
|
| 29 | foreach ($taggedServices as $id => $tags) { |
|
| 30 | $definition->addMethodCall('addAlgorithm', [new Reference($id)]); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 18-33 (lines=16) @@ | ||
| 15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
| 16 | use Symfony\Component\DependencyInjection\Reference; |
|
| 17 | ||
| 18 | final class CompressionCompilerPass implements CompilerPassInterface |
|
| 19 | { |
|
| 20 | public function process(ContainerBuilder $container) |
|
| 21 | { |
|
| 22 | if (!$container->hasDefinition('jose.compression_manager')) { |
|
| 23 | return; |
|
| 24 | } |
|
| 25 | ||
| 26 | $definition = $container->getDefinition('jose.compression_manager'); |
|
| 27 | ||
| 28 | $taggedServices = $container->findTaggedServiceIds('jose.compression'); |
|
| 29 | foreach ($taggedServices as $id => $tags) { |
|
| 30 | $definition->addMethodCall('addCompressionMethod', [new Reference($id)]); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||