findDefinition('nelmio_api_doc.open_api.generator'); foreach ($this->findAndSortTaggedServices('nelmio_api_doc.swagger.processor', $container) as $reference) { $id = (string) $reference; $tags = $container->findDefinition($id)->getTags(); /** * Before which processor should this processor be run? * * @var string|null */ $before = null; // See if the processor has a 'before' attribute. foreach ($tags as $tag) { if (isset($tag['before'])) { $before = $tag['before']; } } $definition->addMethodCall('addProcessor', [new Reference($id), $before]); } } }