mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
DataArrayHelper: readability
This commit is contained in:
parent
348c2d9de4
commit
be9fcfc3c2
@ -6,6 +6,8 @@ use InvalidArgumentException;
|
||||
use function array_diff;
|
||||
use function array_key_exists;
|
||||
use function implode;
|
||||
use function is_array;
|
||||
use function is_object;
|
||||
|
||||
class DataArrayHelper
|
||||
{
|
||||
@ -13,7 +15,8 @@ class DataArrayHelper
|
||||
{
|
||||
if (is_object($value)) {
|
||||
return (array) $value;
|
||||
} elseif (! is_array($value)) {
|
||||
}
|
||||
if (! is_array($value)) {
|
||||
throw new InvalidDataException('Object', $value);
|
||||
}
|
||||
|
||||
@ -42,4 +45,4 @@ class DataArrayHelper
|
||||
throw new InvalidArgumentException('Missing properties: ' . implode(', ', $missing));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user