diff --git a/src/XmlToPhpConfigConverter.php b/src/XmlToPhpConfigConverter.php index 6f8c346..6b9aaf3 100644 --- a/src/XmlToPhpConfigConverter.php +++ b/src/XmlToPhpConfigConverter.php @@ -44,6 +44,13 @@ public function convertFile(string $xmlPath): string $output .= $this->nl(0); $output .= $this->nl().'namespace Symfony\Component\DependencyInjection\Loader\Configurator;'; $output .= $this->nl(0); + + // Explicitly use functions from the Configurator namespace, to help static analysis tools + foreach (['service', 'inline_service', 'service_locator', 'iterator', 'expr', 'abstract_arg', 'env', 'service_closure', 'closure', 'tagged_iterator', 'tagged_locator'] as $functionName) { + $output .= $this->nl().'use function \\Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\'.$functionName.';'; + } + $output .= $this->nl(0); + $output .= $this->nl().'return static function(ContainerConfigurator $container) {'; // Process the root container element and its children