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.
23 lines
475 B
PHP
23 lines
475 B
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class Min extends AbstractRule
|
|
{
|
|
public $inclusive;
|
|
public $minValue;
|
|
|
|
public function __construct($minValue, $inclusive = false)
|
|
{
|
|
$this->minValue = $minValue;
|
|
$this->inclusive = $inclusive;
|
|
}
|
|
|
|
public function validate($input)
|
|
{
|
|
if ($this->inclusive) {
|
|
return $input >= $this->minValue;
|
|
} else {
|
|
return $input > $this->minValue;
|
|
}
|
|
}
|
|
}
|