Closed
Description
Currently null default values are not correctly applied. I think this happens because validateCommonProperties, in UndefinedConstraint.php, uses isset to check whether a default value has been defined and it cannot distinguish between a null default value and an undefined one.
// e.g.
if (!$this->getTypeCheck()->propertyExists($value, $i) && isset($propertyDefinition->default)) {
Moreover, when the subject is an array and default properties or items have been defined, non-null default values are applied even if the properties or the items have a null value. Again, I think this happens because the code uses isset to check whether the property or the item exists.
if (!isset($value[$i]) && isset($propertyDefinition->default)) {
// ...
if (!isset($value[$i]) && isset($itemDefinition->default)) {
Metadata
Metadata
Assignees
Labels
No labels