Merge pull request #1955 from thomaspicquet/master

Fixed Areas attribute to work like the documentation specifies
This commit is contained in:
Guilhem Niot 2022-02-28 11:52:28 +01:00 committed by GitHub
commit 7d827d5141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,10 @@ final class Areas
public function __construct(array $properties) public function __construct(array $properties)
{ {
if (!array_key_exists('value', $properties) || !is_array($properties['value'])) { if (!array_key_exists('value', $properties) || !is_array($properties['value'])) {
$properties['value'] = array_values($properties);
}
if ([] === $properties['value']) {
throw new \InvalidArgumentException('An array of areas was expected'); throw new \InvalidArgumentException('An array of areas was expected');
} }