$this->allowExtraFields =
$allowExtraFields ??
$this->allowExtraFields;
$this->allowMissingFields =
$allowMissingFields ??
$this->allowMissingFields;
$this->extraFieldsMessage =
$extraFieldsMessage ??
$this->extraFieldsMessage;
$this->missingFieldsMessage =
$missingFieldsMessage ??
$this->missingFieldsMessage;
} /**
* @return void
*/
protected function initializeNestedConstraints() { parent::
initializeNestedConstraints();
if (!\
is_array($this->fields
)) { throw new ConstraintDefinitionException(sprintf('The option "fields" is expected to be an array in constraint "%s".', __CLASS__
));
} foreach ($this->fields
as $fieldName =>
$field) { // the XmlFileLoader and YamlFileLoader pass the field Optional
// and Required constraint as an array with exactly one element
if (\
is_array($field) && 1 == \
count($field)) { $this->fields
[$fieldName] =
$field =
$field[0
];
}