tao-test/app/vendor/respect/validation/docs/rules/Countable.md

21 lines
445 B
Markdown
Raw Normal View History

2022-08-29 20:14:13 +02:00
# Countable
- `v::countable()`
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
```
***
See also:
* [ArrayType](ArrayType.md)
* [ArrayVal](ArrayVal.md)
* [Instance](Instance.md)
* [IterableType](IterableType.md)