diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index e468867af..058a80570 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -160,7 +160,7 @@ public function __construct() throw AnnotationException::optimizerPlusSaveComments(); } - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); + require_once __DIR__ . '/Annotation/IgnoreAnnotation.php'; $this->parser = new DocParser; $this->preParser = new DocParser; diff --git a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php index 6135f53d3..79ad3b813 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php @@ -21,6 +21,8 @@ /** * AnnotationRegistry + * + * @deprecated Rely on spl_register_autoloader() autoloaders instead */ final class AnnotationRegistry { diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php index e58e3400c..c6d60446a 100644 --- a/lib/Doctrine/Common/Annotations/DocParser.php +++ b/lib/Doctrine/Common/Annotations/DocParser.php @@ -401,13 +401,8 @@ private function classExists($fqcn) return $this->classExists[$fqcn]; } - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); + return $this->classExists[$fqcn] = class_exists($fqcn) || AnnotationRegistry::loadAnnotationClass($fqcn); } /** @@ -429,10 +424,10 @@ private function collectAnnotationMetadata($name) 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes' )); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php'); + require_once __DIR__ . '/Annotation/Enum.php'; + require_once __DIR__ . '/Annotation/Target.php'; + require_once __DIR__ . '/Annotation/Attribute.php'; + require_once __DIR__ . '/Annotation/Attributes.php'; } $class = new \ReflectionClass($name); @@ -474,7 +469,7 @@ private function collectAnnotationMetadata($name) // collect all public properties foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { $metadata['properties'][$property->name] = $property->name; - + if (false === ($propertyComment = $property->getDocComment())) { continue; }