Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09d900f

Browse files
committed
Merge branch 'DDC-1937' into 2.2
2 parents 14d6f36 + 6dfd812 commit 09d900f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
142142

143143
$classAnnotations = $this->_reader->getClassAnnotations($class);
144144

145-
if ($classAnnotations && is_numeric(key($classAnnotations))) {
146-
foreach ($classAnnotations as $annot) {
145+
if ($classAnnotations) {
146+
foreach ($classAnnotations as $key => $annot) {
147+
if ( ! is_numeric($key)) {
148+
continue;
149+
}
150+
147151
$classAnnotations[get_class($annot)] = $annot;
148152
}
149153
}
@@ -432,8 +436,11 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
432436
if ($method->isPublic() && $method->getDeclaringClass()->getName() == $class->name) {
433437
$annotations = $this->_reader->getMethodAnnotations($method);
434438

435-
if ($annotations && is_numeric(key($annotations))) {
436-
foreach ($annotations as $annot) {
439+
if ($annotations) {
440+
foreach ($annotations as $key => $annot) {
441+
if ( ! is_numeric($key)) {
442+
continue;
443+
}
437444
$annotations[get_class($annot)] = $annot;
438445
}
439446
}

0 commit comments

Comments
 (0)