mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-10 11:39:25 +03:00
keep it BC
This commit is contained in:
parent
ebde54f251
commit
11f61af93b
@ -22,12 +22,17 @@ final class Areas
|
|||||||
|
|
||||||
public function __construct(array $properties)
|
public function __construct(array $properties)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!array_key_exists('value', $properties) || !is_array($properties['value'])) {
|
||||||
|
$properties = array_values($properties);
|
||||||
|
}
|
||||||
|
|
||||||
if ([] === $properties) {
|
if ([] === $properties) {
|
||||||
throw new \InvalidArgumentException('An array of areas was expected');
|
throw new \InvalidArgumentException('An array of areas was expected');
|
||||||
}
|
}
|
||||||
|
|
||||||
$areas = [];
|
$areas = [];
|
||||||
foreach ($properties as $area) {
|
foreach ($properties['value'] as $area) {
|
||||||
if (!is_string($area)) {
|
if (!is_string($area)) {
|
||||||
throw new \InvalidArgumentException('An area must be given as a string');
|
throw new \InvalidArgumentException('An area must be given as a string');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user