mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 23:35:45 +01:00
17 lines
368 B
Markdown
17 lines
368 B
Markdown
# 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:
|
|
|
|
* [ObjectType](ObjectType.md)
|