From 62cb0cc5d29d0584a85bd801c56ec2c2f9045533 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 21 Jan 2021 15:25:33 +0100 Subject: [PATCH] TDBM Bundle automatically register the code generator listeners --- ...heCodingMachineTdbmGraphqlCompilerPass.php | 63 ------------------- TheCodingMachineTdbmGraphqlBundle.php | 9 --- 2 files changed, 72 deletions(-) delete mode 100644 DependencyInjection/TheCodingMachineTdbmGraphqlCompilerPass.php diff --git a/DependencyInjection/TheCodingMachineTdbmGraphqlCompilerPass.php b/DependencyInjection/TheCodingMachineTdbmGraphqlCompilerPass.php deleted file mode 100644 index 03e4d82..0000000 --- a/DependencyInjection/TheCodingMachineTdbmGraphqlCompilerPass.php +++ /dev/null @@ -1,63 +0,0 @@ -findDefinition(Configuration::class); - $arguments = $configuration->getArguments(); - - $generationListeners = $arguments[7] ?? []; - $codeGenerationListeners = $arguments[9] ?? []; - - $generationListeners[] = new Reference(GraphQLTypeAnnotator::class); - $codeGenerationListeners[] = new Reference(GraphQLTypeAnnotator::class); - - $configuration->setArgument(7, $generationListeners); - $configuration->setArgument(9, $codeGenerationListeners); - } -} diff --git a/TheCodingMachineTdbmGraphqlBundle.php b/TheCodingMachineTdbmGraphqlBundle.php index beb7dfa..7d2797e 100644 --- a/TheCodingMachineTdbmGraphqlBundle.php +++ b/TheCodingMachineTdbmGraphqlBundle.php @@ -3,17 +3,8 @@ namespace TheCodingMachine\Tdbm\Graphql\Bundle; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; -use TheCodingMachine\Tdbm\Graphql\Bundle\DependencyInjection\TheCodingMachineTdbmGraphqlCompilerPass; class TheCodingMachineTdbmGraphqlBundle extends Bundle { - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new TheCodingMachineTdbmGraphqlCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); - } }