Skip to content

Commit 617bf78

Browse files
committed
bug symfony#17416 [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn'… (dunglas)
This PR was merged into the 2.8 branch. Discussion ---------- [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn'… | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 73db0ec [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn't exist
2 parents 3223c25 + 73db0ec commit 617bf78

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private function getDocBlock($class, $property)
189189
break;
190190

191191
default:
192-
$data = array(null, null);
192+
$data = array(null, null, null);
193193
}
194194

195195
return $this->docBlocks[$propertyHash] = $data;

src/Symfony/Component/PropertyInfo/Tests/Extractors/PhpDocExtractorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function typesProvider()
6767
array('d', array(new Type(Type::BUILTIN_TYPE_BOOL)), null, null),
6868
array('e', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_RESOURCE))), null, null),
6969
array('f', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))), null, null),
70+
array('donotexist', null, null, null),
7071
);
7172
}
7273
}

src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function typesProvider()
7171
array('d', array(new Type(Type::BUILTIN_TYPE_BOOL))),
7272
array('e', null),
7373
array('f', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime')))),
74+
array('donotexist', null),
7475
);
7576
}
7677

@@ -89,6 +90,7 @@ public function php7TypesProvider()
8990
array('foo', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true))),
9091
array('bar', array(new Type(Type::BUILTIN_TYPE_INT))),
9192
array('baz', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING)))),
93+
array('donotexist', null),
9294
);
9395
}
9496

0 commit comments

Comments
 (0)