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

593 B

File

  • v::file()

Validates files.

v::file()->validate(__FILE__); // true
v::file()->validate(__DIR__); // false

This validator will consider SplFileInfo instances, so you can do something like:

v::file()->validate(new \SplFileInfo($file));

See also: