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