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

21 lines
454 B
Markdown
Raw Normal View History

2022-08-29 20:14:13 +02:00
# Instance
- `v::instance(string $instanceName)`
Validates if the input is an instance of the given class or interface.
```php
v::instance('DateTime')->validate(new DateTime); // true
v::instance('Traversable')->validate(new ArrayObject); // true
```
Message template for this validator includes `{{instanceName}}`.
***
See also:
* [Countable](Countable.md)
* [IterableType](IterableType.md)
* [ObjectType](ObjectType.md)
* [Type](Type.md)