respect-validation/docs/rules/Instance.md
2018-12-11 13:31:50 +01:00

521 B

Instance

  • 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}}.

Changelog

Version Description
0.3.9 Created

See also: