1818use Doctrine \ODM \PHPCR \Version as PHPCRVersion ;
1919use Doctrine \ORM \Mapping \Driver \XmlDriver as ORMXmlDriver ;
2020use Doctrine \ORM \Version as ORMVersion ;
21- use Symfony \Bridge \Doctrine \DependencyInjection \CompilerPass \RegisterMappingsPass ;
2221use Symfony \Cmf \Bundle \RoutingBundle \DependencyInjection \Compiler \ValidationPass ;
2322use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
2423use Symfony \Component \DependencyInjection \Definition ;
2726use Symfony \Cmf \Component \Routing \DependencyInjection \Compiler \RegisterRoutersPass ;
2827use Symfony \Cmf \Component \Routing \DependencyInjection \Compiler \RegisterRouteEnhancersPass ;
2928use Symfony \Cmf \Bundle \RoutingBundle \DependencyInjection \Compiler \SetRouterPass ;
30- use Symfony \Cmf \Bundle \CoreBundle \DependencyInjection \Compiler \DoctrineOrmMappingsPass as CmfDoctrineOrmMappingsPass ;
3129
3230/**
3331 * Bundle class.
@@ -57,9 +55,7 @@ public function build(ContainerBuilder $container)
5755 */
5856 private function buildPhpcrCompilerPass (ContainerBuilder $ container )
5957 {
60- if (!class_exists (DoctrinePhpcrMappingsPass::class)
61- || !class_exists (PHPCRVersion::class)
62- ) {
58+ if (!class_exists (PHPCRVersion::class)) {
6359 return ;
6460 }
6561
@@ -91,16 +87,11 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
9187 return ;
9288 }
9389
94- $ doctrineOrmCompiler = $ this ->findDoctrineOrmCompiler ();
95- if (!$ doctrineOrmCompiler ) {
96- return ;
97- }
98-
9990 $ container ->addCompilerPass (
100- $ this ->buildBaseCompilerPass ($ doctrineOrmCompiler , ORMXmlDriver::class, 'orm ' )
91+ $ this ->buildBaseCompilerPass (DoctrineOrmMappingsPass::class , ORMXmlDriver::class, 'orm ' )
10192 );
10293 $ container ->addCompilerPass (
103- $ doctrineOrmCompiler ::createXmlMappingDriver (
94+ DoctrineOrmMappingsPass ::createXmlMappingDriver (
10495 [
10596 realpath (__DIR__ .'/Resources/config/doctrine-model ' ) => 'Symfony\Cmf\Bundle\RoutingBundle\Model ' ,
10697 realpath (__DIR__ .'/Resources/config/doctrine-orm ' ) => 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm ' ,
@@ -112,7 +103,7 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
112103 );
113104
114105 $ container ->addCompilerPass (
115- $ doctrineOrmCompiler ::createXmlMappingDriver (
106+ DoctrineOrmMappingsPass ::createXmlMappingDriver (
116107 [
117108 realpath (__DIR__ .'/Resources/config/doctrine-model ' ) => 'Symfony\Cmf\Bundle\RoutingBundle\Model ' ,
118109 ],
@@ -123,29 +114,6 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
123114 );
124115 }
125116
126- /**
127- * Looks for a mapping compiler pass. If available, use the one from
128- * DoctrineBundle (available only since DoctrineBundle 2.4 and Symfony 2.3)
129- * Otherwise use the standalone one from CmfCoreBundle.
130- *
131- * @return bool|string the compiler pass to use or false if no suitable
132- * one was found
133- */
134- private function findDoctrineOrmCompiler ()
135- {
136- if (class_exists (RegisterMappingsPass::class)
137- && class_exists (DoctrineOrmMappingsPass::class)
138- ) {
139- return DoctrineOrmMappingsPass::class;
140- }
141-
142- if (class_exists (CmfDoctrineOrmMappingsPass::class)) {
143- return CmfDoctrineOrmMappingsPass::class;
144- }
145-
146- return false ;
147- }
148-
149117 /**
150118 * Builds the compiler pass for the symfony core routing component. The
151119 * compiler pass factory method uses the SymfonyFileLocator which does
0 commit comments