mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 07:15:45 +01:00
Most changes was made by php-cs-fixer. Also removes unused `RecursiveTreeIterator` class.
15 lines
291 B
PHP
15 lines
291 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class Exists extends AbstractRule
|
|
{
|
|
public function validate($input)
|
|
{
|
|
if ($input instanceof \SplFileInfo) {
|
|
$input = $input->getPathname();
|
|
}
|
|
|
|
return (is_string($input) && file_exists($input));
|
|
}
|
|
}
|