2016-08-03 09:59:32 +02:00
|
|
|
# IterableType
|
|
|
|
|
2017-03-27 14:47:07 +02:00
|
|
|
- `IterableType()`
|
2016-08-03 09:59:32 +02:00
|
|
|
|
2018-06-01 13:56:01 +02:00
|
|
|
Validates whether the pseudo-type of the input is iterable or not, in other words,
|
|
|
|
if you're able to iterate over it with [foreach](http://php.net/foreach) language
|
|
|
|
construct.
|
2016-08-03 09:59:32 +02:00
|
|
|
|
|
|
|
```php
|
|
|
|
v::iterableType()->validate([]); // true
|
|
|
|
v::iterableType()->validate(new ArrayObject()); // true
|
|
|
|
v::iterableType()->validate(new stdClass()); // true
|
|
|
|
v::iterableType()->validate('string'); // false
|
|
|
|
```
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Types
|
|
|
|
|
2017-03-27 22:04:13 +02:00
|
|
|
## Changelog
|
|
|
|
|
|
|
|
Version | Description
|
|
|
|
--------|-------------
|
|
|
|
1.0.8 | Renamed from `Iterable` to `IterableType`
|
|
|
|
1.0.0 | Created as `Iterable`
|
|
|
|
|
2016-08-03 09:59:32 +02:00
|
|
|
***
|
|
|
|
See also:
|
|
|
|
|
2018-12-11 13:31:50 +01:00
|
|
|
- [ArrayType](ArrayType.md)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [ArrayVal](ArrayVal.md)
|
|
|
|
- [Countable](Countable.md)
|
2018-12-11 13:31:50 +01:00
|
|
|
- [Each](Each.md)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [Instance](Instance.md)
|