wmde / Number

Numerical value objects, parsers and formatters
Other
18 stars 6 forks source link

Less strict array req in UnboundedQuantityValue::newFromArray #105

Closed manicki closed 7 years ago

manicki commented 7 years ago

Users of newFromArray give no guarantee that the value passed in is actually the array. DataValueObject::requireArrayFields asserts that the value is an array, and throws the exception that callers can handle. Having no strict array requirement lets callers handle erroneous input nicer. Other DataValue classes already seem to follow similar pattern.

Strict array requirement was related to: https://phabricator.wikimedia.org/T168681