mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 15:25:45 +01:00
21 lines
437 B
PHP
21 lines
437 B
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class False extends AbstractRule
|
|
{
|
|
public function validate($input)
|
|
{
|
|
if (! is_string($input) || is_numeric($input)) {
|
|
return ($input == false);
|
|
}
|
|
|
|
$validValues = array(
|
|
'false',
|
|
'no',
|
|
'off',
|
|
);
|
|
$filteredInput = strtolower($input);
|
|
|
|
return in_array($filteredInput, $validValues);
|
|
}
|
|
}
|