adjust to feedback

This commit is contained in:
David Buchmann 2017-12-19 23:14:57 +01:00
parent 66872da552
commit 72c8c80d9c
2 changed files with 5 additions and 11 deletions

View File

@ -52,7 +52,9 @@ class PhpdocPropertyAnnotationReader
if (!$title = $docBlock->getSummary()) {
/** @var Var_ $var */
foreach ($docBlock->getTagsByName('var') as $var) {
if (!$description = $var->getDescription()) continue;
if (!$description = $var->getDescription()) {
continue;
}
$title = $description->render();
if ($title) break;
}
@ -63,14 +65,5 @@ class PhpdocPropertyAnnotationReader
if ($property->getDescription() === null && $docBlock->getDescription() && $docBlock->getDescription()->render()) {
$property->setDescription($docBlock->getDescription()->render());
}
if ($property->getType() === null) {
/** @var Var_ $var */
foreach ($docBlock->getTagsByName('var') as $var) {
if ($var->getType()) {
$property->setType($var->getType());
break;
}
}
}
}
}

View File

@ -151,7 +151,8 @@ serialization groups when using the Symfony serializer.
### If you're using the JMS Serializer
The metadata of the JMS serializer are used by default to describe your
models. Additional information is extracted from the PHP doc block comment.
models. Additional information is extracted from the PHP doc block comment,
but the property types must be specified in the JMS annotations.
In case you prefer using the [Symfony PropertyInfo component](https://symfony.com/doc/current/components/property_info.html) (you
won't be able to use JMS serialization groups), you can disable JMS serializer