Browse Source

removed obsolete compiler pass

Johannes Schmitt 14 years ago
parent
commit
ddc00fa0f6

+ 0 - 31
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Compiler/AddValidatorNamespaceAliasPass.php

@@ -1,31 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Bundle\DoctrineBundle\DependencyInjection\Compiler;
-
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-
-class AddValidatorNamespaceAliasPass implements CompilerPassInterface
-{
-    public function process(ContainerBuilder $container)
-    {
-        if (!$container->hasDefinition('validator.mapping.loader.annotation_loader')) {
-            return;
-        }
-
-        $loader = $container->getDefinition('validator.mapping.loader.annotation_loader');
-        $args = $container->getParameterBag()->resolveValue($loader->getArguments());
-
-        $args[0]['assertORM'] = 'Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\';
-        $loader->replaceArgument(0, $args[0]);
-    }
-}

+ 0 - 2
src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

@@ -13,7 +13,6 @@ namespace Symfony\Bundle\DoctrineBundle;
 
 use Symfony\Component\DependencyInjection\Compiler\PassConfig;
 use Symfony\Bundle\DoctrineBundle\DependencyInjection\Compiler\RegisterEventListenersAndSubscribersPass;
-use Symfony\Bundle\DoctrineBundle\DependencyInjection\Compiler\AddValidatorNamespaceAliasPass;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\HttpKernel\Bundle\Bundle;
 
@@ -30,6 +29,5 @@ class DoctrineBundle extends Bundle
         parent::build($container);
 
         $container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
-        $container->addCompilerPass(new AddValidatorNamespaceAliasPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
     }
 }

+ 7 - 7
tests/Symfony/Tests/Component/Validator/Mapping/Loader/AnnotationLoaderTest.php

@@ -14,7 +14,7 @@ namespace Symfony\Tests\Component\Validator\Mapping\Loader;
 require_once __DIR__.'/../../Fixtures/Entity.php';
 require_once __DIR__.'/../../Fixtures/ConstraintA.php';
 
-use Doctrine\Common\Annotations\Reader;
+use Doctrine\Common\Annotations\AnnotationReader;
 use Symfony\Component\Validator\Constraints\All;
 use Symfony\Component\Validator\Constraints\Collection;
 use Symfony\Component\Validator\Constraints\NotNull;
@@ -28,14 +28,14 @@ class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
 {
     protected function setUp()
     {
-        if (!class_exists('Doctrine\Common\Annotations\Reader')) {
+        if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
             $this->markTestSkipped('Unmet dependency: Annotations is required for this test');
         }
     }
 
     public function testLoadClassMetadataReturnsTrueIfSuccessful()
     {
-        $loader = new AnnotationLoader(new Reader());
+        $loader = new AnnotationLoader(new AnnotationReader());
         $metadata = new ClassMetadata('Symfony\Tests\Component\Validator\Fixtures\Entity');
 
         $this->assertTrue($loader->loadClassMetadata($metadata));
@@ -43,7 +43,7 @@ class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
 
     public function testLoadClassMetadataReturnsFalseIfNotSuccessful()
     {
-        $loader = new AnnotationLoader(new Reader());
+        $loader = new AnnotationLoader(new AnnotationReader());
         $metadata = new ClassMetadata('\stdClass');
 
         $this->assertFalse($loader->loadClassMetadata($metadata));
@@ -51,7 +51,7 @@ class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
 
     public function testLoadClassMetadata()
     {
-        $loader = new AnnotationLoader($reader = new Reader());
+        $loader = new AnnotationLoader(new AnnotationReader());
         $metadata = new ClassMetadata('Symfony\Tests\Component\Validator\Fixtures\Entity');
 
         $loader->loadClassMetadata($metadata);
@@ -84,7 +84,7 @@ class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
      */
     public function testLoadParentClassMetadata()
     {
-        $loader = new AnnotationLoader(new Reader());
+        $loader = new AnnotationLoader(new AnnotationReader());
 
         // Load Parent MetaData
         $parent_metadata = new ClassMetadata('Symfony\Tests\Component\Validator\Fixtures\EntityParent');
@@ -101,7 +101,7 @@ class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
      */
     public function testLoadClassMetadataAndMerge()
     {
-        $loader = new AnnotationLoader($reader = new Reader());
+        $loader = new AnnotationLoader(new AnnotationReader());
 
         // Load Parent MetaData
         $parent_metadata = new ClassMetadata('Symfony\Tests\Component\Validator\Fixtures\EntityParent');