From cfc269aca47ec9097ab9b1b053f1d5850feb2163 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 19 Mar 2020 15:53:09 +0000 Subject: [PATCH] [CORE][SCHEMADEF] Clean up SchemaDef compiler pass --- .../{SchemaDefCompilerPass.php => SchemaDefPass.php} | 4 +--- src/Kernel.php | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) rename src/DependencyInjection/Compiler/{SchemaDefCompilerPass.php => SchemaDefPass.php} (78%) diff --git a/src/DependencyInjection/Compiler/SchemaDefCompilerPass.php b/src/DependencyInjection/Compiler/SchemaDefPass.php similarity index 78% rename from src/DependencyInjection/Compiler/SchemaDefCompilerPass.php rename to src/DependencyInjection/Compiler/SchemaDefPass.php index 1f6cfb4b86..9814d5afff 100644 --- a/src/DependencyInjection/Compiler/SchemaDefCompilerPass.php +++ b/src/DependencyInjection/Compiler/SchemaDefPass.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\Reference; /** * Register a new ORM driver to allow use to use the old schemaDef format */ -class SchemaDefCompilerPass implements CompilerPassInterface +class SchemaDefPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { @@ -17,7 +17,5 @@ class SchemaDefCompilerPass implements CompilerPassInterface ->addMethodCall('addDriver', [new Reference('app.util.schemadef_driver'), 'App\\Entity'] ); - - $container->setParameter('doctrine.orm.metadata.schemadef.class', App\Util\SchemaDefDriver::class); } } diff --git a/src/Kernel.php b/src/Kernel.php index a38b28f0e6..0bcdcc6a47 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -2,14 +2,13 @@ namespace App; -use App\DependencyInjection\Compiler\SchemaDefCompilerPass; +use App\DependencyInjection\Compiler\SchemaDefPass; use const PHP_VERSION_ID; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; - use Symfony\Component\Routing\RouteCollectionBuilder; class Kernel extends BaseKernel @@ -59,6 +58,6 @@ class Kernel extends BaseKernel { parent::build($container); - $container->addCompilerPass(new SchemaDefCompilerPass($container)); + $container->addCompilerPass(new SchemaDefPass($container)); } }