From fb7722822da01df3ada1f6587dcb1474cbb6da2a Mon Sep 17 00:00:00 2001 From: Aleksandr Moroz Date: Mon, 10 Dec 2012 11:02:57 +0200 Subject: [PATCH 1/3] when is ignored annotation name - not check class exists --- lib/Doctrine/Common/Annotations/DocParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php index 5896e2375..41dc70b16 100644 --- a/lib/Doctrine/Common/Annotations/DocParser.php +++ b/lib/Doctrine/Common/Annotations/DocParser.php @@ -620,10 +620,10 @@ private function Annotation() $name = $this->imports[$loweredAlias]; } $found = true; - } elseif (isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) { + } elseif (!isset($this->ignoredAnnotationNames[$name]) && isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) { $name = $this->imports['__NAMESPACE__'].'\\'.$name; $found = true; - } elseif ($this->classExists($name)) { + } elseif (!isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { $found = true; } From 5fc86b3ef4d7e39f739bd2eec1aa3627aa1c1155 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 10 Dec 2012 22:22:46 +0200 Subject: [PATCH 2/3] Add test. Class not be included when it in @ignoreAnnotation --- .../Common/Annotations/AbstractReaderTest.php | 7 +++++++ .../Fixtures/ClassWithIgnoreAnnotation.php | 14 ++++++++++++++ .../Annotations/Fixtures/IgnoreAnnotationClass.php | 5 +++++ .../Annotations/SimpleAnnotationReaderTest.php | 8 ++++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php create mode 100644 tests/Doctrine/Tests/Common/Annotations/Fixtures/IgnoreAnnotationClass.php diff --git a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php index 96ea76881..65eb887c9 100644 --- a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php @@ -253,6 +253,13 @@ public function testNonAnnotationProblem() $this->assertInstanceOf($name, $annot); } + public function testIncludeIgnoreAnnotation() + { + $reader = $this->getReader(); + $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithIgnoreAnnotation', 'foo')); + $this->assertFalse(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\IgnoreAnnotationClass', false)); + } + public function testImportWithConcreteAnnotation() { $reader = $this->getReader(); diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php new file mode 100644 index 000000000..c24457e08 --- /dev/null +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php @@ -0,0 +1,14 @@ + Date: Mon, 10 Dec 2012 22:34:42 +0200 Subject: [PATCH 3/3] Revert "Add test. Class not be included when it in @ignoreAnnotation" This reverts commit 5fc86b3ef4d7e39f739bd2eec1aa3627aa1c1155. --- .../Common/Annotations/AbstractReaderTest.php | 7 ------- .../Fixtures/ClassWithIgnoreAnnotation.php | 14 -------------- .../Annotations/Fixtures/IgnoreAnnotationClass.php | 5 ----- .../Annotations/SimpleAnnotationReaderTest.php | 8 -------- 4 files changed, 34 deletions(-) delete mode 100644 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php delete mode 100644 tests/Doctrine/Tests/Common/Annotations/Fixtures/IgnoreAnnotationClass.php diff --git a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php index 65eb887c9..96ea76881 100644 --- a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php @@ -253,13 +253,6 @@ public function testNonAnnotationProblem() $this->assertInstanceOf($name, $annot); } - public function testIncludeIgnoreAnnotation() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithIgnoreAnnotation', 'foo')); - $this->assertFalse(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\IgnoreAnnotationClass', false)); - } - public function testImportWithConcreteAnnotation() { $reader = $this->getReader(); diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php deleted file mode 100644 index c24457e08..000000000 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithIgnoreAnnotation.php +++ /dev/null @@ -1,14 +0,0 @@ -