private function createMetadata(ApiProperty $annotation, PropertyMetadata $parentPropertyMetadata = null) : PropertyMetadata
{
if (null === $parentPropertyMetadata) {
return new PropertyMetadata(null, $annotation->description, $annotation->readable, $annotation->writable, $annotation->readableLink, $annotation->writableLink, $annotation->required, $annotation->identifier, $annotation->iri, null, $annotation->attributes);
}
$propertyMetadata = $parentPropertyMetadata;
foreach ([['get', 'description'], ['is', 'readable'], ['is', 'writable'], ['is', 'readableLink'], ['is', 'writableLink'], ['is', 'required'], ['get', 'iri'], ['is', 'identifier'], ['get', 'attributes']] as $property) {
$propertyMetadata = $this->createWith($propertyMetadata, $property, $annotation->{$property[1]});
}
return $propertyMetadata;
}