| @@ 328-336 (lines=9) @@ | ||
| 325 | * |
|
| 326 | * @throws InvalidArgumentException |
|
| 327 | */ |
|
| 328 | public static function isArrayAccessible($value, $message = '') |
|
| 329 | { |
|
| 330 | if (!\is_array($value) && !($value instanceof ArrayAccess)) { |
|
| 331 | static::reportInvalidArgument(\sprintf( |
|
| 332 | $message ?: 'Expected an array accessible. Got: %s', |
|
| 333 | static::typeToString($value) |
|
| 334 | )); |
|
| 335 | } |
|
| 336 | } |
|
| 337 | ||
| 338 | /** |
|
| 339 | * @psalm-pure |
|
| @@ 371-379 (lines=9) @@ | ||
| 368 | * |
|
| 369 | * @throws InvalidArgumentException |
|
| 370 | */ |
|
| 371 | public static function isIterable($value, $message = '') |
|
| 372 | { |
|
| 373 | if (!\is_array($value) && !($value instanceof Traversable)) { |
|
| 374 | static::reportInvalidArgument(\sprintf( |
|
| 375 | $message ?: 'Expected an iterable. Got: %s', |
|
| 376 | static::typeToString($value) |
|
| 377 | )); |
|
| 378 | } |
|
| 379 | } |
|
| 380 | ||
| 381 | /** |
|
| 382 | * @psalm-pure |
|