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

454 B

Instance

  • v::instance(string $instanceName)

Validates if the input is an instance of the given class or interface.

v::instance('DateTime')->validate(new DateTime); // true
v::instance('Traversable')->validate(new ArrayObject); // true

Message template for this validator includes {{instanceName}}.


See also: