2015-10-17 22:08:25 +02:00
|
|
|
# Countable
|
|
|
|
|
2017-03-27 14:47:07 +02:00
|
|
|
- `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
|
|
|
|
```
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Types
|
|
|
|
|
2017-03-27 22:04:13 +02:00
|
|
|
## 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)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [ArrayVal](ArrayVal.md)
|
|
|
|
- [Instance](Instance.md)
|
|
|
|
- [IterableType](IterableType.md)
|