2015-01-30 09:40:06 +01:00
|
|
|
# Instance
|
|
|
|
|
2017-03-27 14:47:07 +02:00
|
|
|
- `Instance(string $instanceName)`
|
2015-01-30 09:40:06 +01:00
|
|
|
|
|
|
|
Validates if the input is an instance of the given class or interface.
|
|
|
|
|
|
|
|
```php
|
2015-10-20 02:53:25 +02:00
|
|
|
v::instance('DateTime')->validate(new DateTime); // true
|
|
|
|
v::instance('Traversable')->validate(new ArrayObject); // true
|
2015-01-30 09:40:06 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Message template for this validator includes `{{instanceName}}`.
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Objects
|
|
|
|
|
2017-03-27 22:04:13 +02:00
|
|
|
## Changelog
|
|
|
|
|
|
|
|
Version | Description
|
|
|
|
--------|-------------
|
|
|
|
0.3.9 | Created
|
|
|
|
|
2015-08-20 06:38:41 +02:00
|
|
|
***
|
2015-01-30 09:40:06 +01:00
|
|
|
See also:
|
|
|
|
|
2018-12-11 13:31:50 +01:00
|
|
|
- [Countable](Countable.md)
|
|
|
|
- [IterableType](IterableType.md)
|
2017-03-28 11:53:14 +02:00
|
|
|
- [ObjectType](ObjectType.md)
|
2018-12-11 13:31:50 +01:00
|
|
|
- [Type](Type.md)
|