From 11f61af93b9a26e64a734d4eb371a3adf6090f99 Mon Sep 17 00:00:00 2001 From: Thomas Picquet Date: Fri, 28 Jan 2022 07:37:28 -0800 Subject: [PATCH] keep it BC --- Annotation/Areas.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Annotation/Areas.php b/Annotation/Areas.php index 805275d..bd173cb 100644 --- a/Annotation/Areas.php +++ b/Annotation/Areas.php @@ -22,12 +22,17 @@ final class Areas public function __construct(array $properties) { + + if (!array_key_exists('value', $properties) || !is_array($properties['value'])) { + $properties = array_values($properties); + } + if ([] === $properties) { throw new \InvalidArgumentException('An array of areas was expected'); } $areas = []; - foreach ($properties as $area) { + foreach ($properties['value'] as $area) { if (!is_string($area)) { throw new \InvalidArgumentException('An area must be given as a string'); }