respect-validation/docs/rules/Instance.md

31 lines
551 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Instance
- `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
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}}`.
## Categorization
- Objects
## Changelog
Version | Description
--------|-------------
0.3.9 | Created
***
2015-01-30 09:40:06 +01:00
See also:
2018-12-11 13:31:50 +01:00
- [Countable](Countable.md)
- [IterableType](IterableType.md)
- [ObjectType](ObjectType.md)
2018-12-11 13:31:50 +01:00
- [Type](Type.md)