mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Fixed Areas attribute to work like the documentation specifies
This commit is contained in:
parent
1885d25cd9
commit
53954031b5
@ -22,12 +22,12 @@ final class Areas
|
|||||||
|
|
||||||
public function __construct(array $properties)
|
public function __construct(array $properties)
|
||||||
{
|
{
|
||||||
if (!array_key_exists('value', $properties) || !is_array($properties['value'])) {
|
if ($properties === []) {
|
||||||
throw new \InvalidArgumentException('An array of areas was expected');
|
throw new \InvalidArgumentException('An array of areas was expected');
|
||||||
}
|
}
|
||||||
|
|
||||||
$areas = [];
|
$areas = [];
|
||||||
foreach ($properties['value'] as $area) {
|
foreach ($properties 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