$name =
$this->
getSingularName($node);
$prototype =
$node->
getPrototype();
$methodName =
$name;
$hasNormalizationClosures =
$this->
hasNormalizationClosures($node) ||
$this->
hasNormalizationClosures($prototype);
$nodeParameterTypes =
$this->
getParameterTypes($node);
$prototypeParameterTypes =
$this->
getParameterTypes($prototype);
if (!
$prototype instanceof ArrayNode
|| ($prototype instanceof PrototypedArrayNode &&
$prototype->
getPrototype() instanceof ScalarNode
)) { $class->
addUse(ParamConfigurator::
class);
$property =
$class->
addProperty($node->
getName());
if (null ===
$key =
$node->
getKeyAttribute()) { // This is an array of values; don't use singular name
$nodeTypesWithoutArray =
array_filter($nodeParameterTypes,
static fn ($type) => 'array' !==
$type);
$body = '
/**
* @param ParamConfigurator|list<ParamConfigurator|PROTOTYPE_TYPE>EXTRA_TYPE $value
*
* @return $this
*/
public function NAME(PARAM_TYPE $value): static
{
$this->_usedProperties[\'PROPERTY\'] = true;
$this->PROPERTY = $value;
return $this;
}';