annotationsReader = $annotationsReader; } /** * @param \ReflectionProperty $reflectionProperty * @param Items|Schema $property */ public function updateWithSwaggerPropertyAnnotation(\ReflectionProperty $reflectionProperty, $property) { $swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class); if ($swgProperty instanceof SwgProperty) { if (null !== $swgProperty->type) { $property->setType($swgProperty->type); } if (null !== $swgProperty->readOnly) { $property->setReadOnly($swgProperty->readOnly); } if ($property instanceof Schema) { if (null !== $swgProperty->description) { $property->setDescription($swgProperty->description); } if (null !== $swgProperty->title) { $property->setTitle($swgProperty->title); } if (null !== $swgProperty->example) { $property->setExample((string) $swgProperty->example); } } } } }