Merge fixes

This commit is contained in:
Guilhem Niot 2018-01-13 13:37:17 +01:00
commit b5fb133533
2 changed files with 27 additions and 34 deletions

View File

@ -36,11 +36,8 @@ class PhpdocPropertyAnnotationReader
/**
* Update the Swagger information with information from the DocBlock comment.
*
* @param \ReflectionProperty $reflectionProperty
* @param Items|Schema $property
*/
public function updateWithPhpdoc(\ReflectionProperty $reflectionProperty, $property)
public function updateWithPhpdoc(\ReflectionProperty $reflectionProperty, Schema $property)
{
try {
$docBlock = $this->docBlockFactory->create($reflectionProperty);

View File

@ -29,14 +29,12 @@ class SwaggerPropertyAnnotationReader
$this->annotationsReader = $annotationsReader;
}
/**
* @param \ReflectionProperty $reflectionProperty
* @param Items|Schema $property
*/
public function updateWithSwaggerPropertyAnnotation(\ReflectionProperty $reflectionProperty, $property)
public function updateWithSwaggerPropertyAnnotation(\ReflectionProperty $reflectionProperty, Schema $property)
{
$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class);
if ($swgProperty instanceof SwgProperty) {
if (!$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class)) {
return;
}
if (null !== $swgProperty->type) {
$property->setType($swgProperty->type);
}
@ -46,7 +44,7 @@ class SwaggerPropertyAnnotationReader
if (null !== $swgProperty->enum) {
$property->setEnum($swgProperty->enum);
}
if ($property instanceof Schema) {
if (null !== $swgProperty->description) {
$property->setDescription($swgProperty->description);
}
@ -60,6 +58,4 @@ class SwaggerPropertyAnnotationReader
$property->setReadOnly($swgProperty->readOnly);
}
}
}
}
}