$allowConstruct =
$context['enable_constructor_extraction'
] ??
$this->enableConstructorExtraction;
$allowAdderRemover =
$context['enable_adder_remover_extraction'
] ?? true;
$camelized =
$this->
camelize($property);
$constructor =
$reflClass->
getConstructor();
$singulars =
$this->inflector->
singularize($camelized);
$errors =
[];
if (null !==
$constructor &&
$allowConstruct) { foreach ($constructor->
getParameters() as $parameter) { if ($parameter->
getName() ===
$property) { return new PropertyWriteInfo(PropertyWriteInfo::TYPE_CONSTRUCTOR,
$property);
} } } [$adderAccessName,
$removerAccessName,
$adderAndRemoverErrors] =
$this->
findAdderAndRemover($reflClass,
$singulars);
if ($allowAdderRemover && null !==
$adderAccessName && null !==
$removerAccessName) { $adderMethod =
$reflClass->
getMethod($adderAccessName);
$removerMethod =
$reflClass->
getMethod($removerAccessName);
$mutator =
new PropertyWriteInfo(PropertyWriteInfo::TYPE_ADDER_AND_REMOVER
);
$mutator->
setAdderInfo(new PropertyWriteInfo(PropertyWriteInfo::TYPE_METHOD,
$adderAccessName,
$this->
getWriteVisiblityForMethod($adderMethod),
$adderMethod->
isStatic()));