| @@ 78-89 (lines=12) @@ | ||
| 75 | * @return bool |
|
| 76 | * @throws InvalidArgumentException |
|
| 77 | */ |
|
| 78 | public static function isArray($value, $strict = true) |
|
| 79 | { |
|
| 80 | if (self::isIterable($value, $strict) && is_array($value)) { |
|
| 81 | return true; |
|
| 82 | } |
|
| 83 | ||
| 84 | if ($strict) { |
|
| 85 | throw new InvalidArgumentException('The value passed must be an array'); |
|
| 86 | } |
|
| 87 | ||
| 88 | return false; |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * @param $value |
|
| @@ 97-108 (lines=12) @@ | ||
| 94 | * @return bool |
|
| 95 | * @throws InvalidArgumentException |
|
| 96 | */ |
|
| 97 | public static function isIterable($value, $strict = true) |
|
| 98 | { |
|
| 99 | if ((is_array($value) || $value instanceof Traversable) && count($value) > 0) { |
|
| 100 | return true; |
|
| 101 | } |
|
| 102 | ||
| 103 | if ($strict) { |
|
| 104 | throw new InvalidArgumentException('The value passed must be iterable'); |
|
| 105 | } |
|
| 106 | ||
| 107 | return false; |
|
| 108 | } |
|
| 109 | ||
| 110 | /** |
|
| 111 | * @param $notification |
|