Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed obsolete compiler pass

  • Loading branch information...
commit ddc00fa0f6bf003bed54c7752fa5c8a4d7fd701d 1 parent 98ed7dd
@schmittjoh schmittjoh authored
View
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]);
- }
-}
View
2  src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
@@ -13,7 +13,6 @@
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 @@ public function build(ContainerBuilder $container)
parent::build($container);
$container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
- $container->addCompilerPass(new AddValidatorNamespaceAliasPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
}
}
View
14 tests/Symfony/Tests/Component/Validator/Mapping/Loader/AnnotationLoaderTest.php
@@ -14,7 +14,7 @@
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 @@ public function testLoadClassMetadataReturnsTrueIfSuccessful()
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 @@ public function testLoadClassMetadataReturnsFalseIfNotSuccessful()
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 @@ public function testLoadClassMetadata()
*/
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 @@ public function testLoadParentClassMetadata()
*/
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');
Please sign in to comment.
Something went wrong with that request. Please try again.