respect-validation/docs/rules/Countable.md

31 lines
556 B
Markdown
Raw Permalink Normal View History

2015-10-17 22:08:25 +02:00
# Countable
- `Countable()`
2015-10-17 22:08:25 +02:00
Validates if the input is countable, in other words, if you're allowed to use
[count()](http://php.net/count) function on it.
```php
v::countable()->validate([]); // true
v::countable()->validate(new ArrayObject()); // true
v::countable()->validate('string'); // false
```
## Categorization
- Types
## Changelog
Version | Description
--------|-------------
1.0.0 | Created from `ArrayVal`
2015-10-17 22:08:25 +02:00
***
See also:
2018-12-11 13:31:50 +01:00
- [ArrayType](ArrayType.md)
- [ArrayVal](ArrayVal.md)
- [Instance](Instance.md)
- [IterableType](IterableType.md)