respect-validation/docs/rules/IterableType.md

35 lines
736 B
Markdown
Raw Normal View History

2016-08-03 09:59:32 +02:00
# IterableType
- `IterableType()`
2016-08-03 09:59:32 +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
```
## Categorization
- Types
## 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)
- [ArrayVal](ArrayVal.md)
- [Countable](Countable.md)
2018-12-11 13:31:50 +01:00
- [Each](Each.md)
- [Instance](Instance.md)