1212use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
1313use Symfony \Component \DependencyInjection \ContainerBuilder ;
1414use Symfony \Component \DependencyInjection \Definition ;
15+ use Symfony \Component \DependencyInjection \Parameter ;
1516use Symfony \Component \DependencyInjection \Reference ;
1617
1718class DbToolsPass implements CompilerPassInterface
@@ -49,7 +50,7 @@ private function registerArrayLoader(array $data, string $connectionName, Contai
4950 {
5051 $ definition = new Definition ();
5152 $ definition ->setClass (ArrayLoader::class);
52- $ definition ->setArguments ([$ data , $ connectionName ]);
53+ $ definition ->setArguments ([$ data , $ connectionName, new Parameter ( ' kernel.project_dir ' ) ]);
5354
5455 $ loaderId = 'db_tools.anonymization.loader.array. ' . $ connectionName ;
5556 $ container ->setDefinition ($ loaderId , $ definition );
@@ -61,7 +62,7 @@ private function registerYamlLoader(string $file, string $connectionName, Contai
6162 {
6263 $ definition = new Definition ();
6364 $ definition ->setClass (YamlLoader::class);
64- $ definition ->setArguments ([$ file , $ connectionName ]);
65+ $ definition ->setArguments ([$ file , $ connectionName, new Parameter ( ' kernel.project_dir ' ) ]);
6566
6667 $ loaderId = 'db_tools.anonymization.loader.yaml. ' . $ connectionName ;
6768 $ container ->setDefinition ($ loaderId , $ definition );
@@ -73,7 +74,7 @@ private function registerAttributesLoader(ContainerBuilder $container): string
7374 {
7475 $ definition = new Definition ();
7576 $ definition ->setClass (AttributesLoader::class);
76- $ definition ->setArguments ([new Reference ('doctrine.orm.command.entity_manager_provider ' )]);
77+ $ definition ->setArguments ([new Reference ('doctrine.orm.command.entity_manager_provider ' ), new Parameter ( ' kernel.project_dir ' ) ]);
7778
7879 $ loaderId = 'db_tools.anonymization.loader.attributes ' ;
7980 $ container ->setDefinition ($ loaderId , $ definition );
0 commit comments