Bluz\Validator\Rule\Length::__construct PHP Метод

__construct() публичный Метод

Setup validation rule
public __construct ( integer | null $min = null, integer | null $max = null, boolean $inclusive = true )
$min integer | null
$max integer | null
$inclusive boolean
    public function __construct($min = null, $max = null, $inclusive = true)
    {
        $this->minValue = $min;
        $this->maxValue = $max;
        $this->inclusive = $inclusive;
        if (!is_null($min) && !is_numeric($min)) {
            throw new ComponentException(__('"%s" is not a valid numeric length', $min));
        }
        if (!is_null($max) && !is_numeric($max)) {
            throw new ComponentException(__('"%s" is not a valid numeric length', $max));
        }
        if (!is_null($min) && !is_null($max) && $min > $max) {
            throw new ComponentException(__('"%s" cannot be less than "%s" for validation', $min, $max));
        }
    }