[CORE][SCHEMADEF] Clean up SchemaDef compiler pass

This commit is contained in:
Hugo Sales 2020-03-19 15:53:09 +00:00 committed by Hugo Sales
parent 23b47b2aeb
commit cfc269aca4
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 3 additions and 6 deletions

View File

@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\Reference;
/** /**
* Register a new ORM driver to allow use to use the old schemaDef format * 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) public function process(ContainerBuilder $container)
{ {
@ -17,7 +17,5 @@ class SchemaDefCompilerPass implements CompilerPassInterface
->addMethodCall('addDriver', ->addMethodCall('addDriver',
[new Reference('app.util.schemadef_driver'), 'App\\Entity'] [new Reference('app.util.schemadef_driver'), 'App\\Entity']
); );
$container->setParameter('doctrine.orm.metadata.schemadef.class', App\Util\SchemaDefDriver::class);
} }
} }

View File

@ -2,14 +2,13 @@
namespace App; namespace App;
use App\DependencyInjection\Compiler\SchemaDefCompilerPass; use App\DependencyInjection\Compiler\SchemaDefPass;
use const PHP_VERSION_ID; use const PHP_VERSION_ID;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder; use Symfony\Component\Routing\RouteCollectionBuilder;
class Kernel extends BaseKernel class Kernel extends BaseKernel
@ -59,6 +58,6 @@ class Kernel extends BaseKernel
{ {
parent::build($container); parent::build($container);
$container->addCompilerPass(new SchemaDefCompilerPass($container)); $container->addCompilerPass(new SchemaDefPass($container));
} }
} }