propertyTypeDecorator = $propertyTypeDecorator;
}
/**
* @param array $fetchedLocalPropertyNameToTypes
* @param string[] $propertyNamesToComplete
* @return Property[]
*/
public function create(array $fetchedLocalPropertyNameToTypes, array $propertyNamesToComplete) : array
{
$newProperties = [];
foreach ($fetchedLocalPropertyNameToTypes as $propertyName => $propertyType) {
if (!\in_array($propertyName, $propertyNamesToComplete, \true)) {
continue;
}
$property = new Property(Class_::MODIFIER_PUBLIC, [new PropertyProperty($propertyName)]);
$this->propertyTypeDecorator->decorateProperty($property, $propertyType);
$newProperties[] = $property;
}
return $newProperties;
}
}