Test si une valeur est plus grande que la valeur de comparaison.

@param string $key         Clé du test.
@param string $lengthValue Taille de la valeur.
@param string $max         Valeur de comparraison.
@param bool   $not         Inverse le test.
518447
protected function sizeMax($key, $lengthValue, $max, $not = true)
    {
        if (($lengthValue > $max) && $not) {
            $this->addReturn($key, 'must', [ ':max' => $max ]);
        } elseif (!($lengthValue > $max) && !$not) {
            $this->addReturn($key, 'not', [ ':max' => $max ]);
        }
    }
1145142
public function setMaxLength($maxLength)
    {
        if (!is_integer($maxLength)) {
            throw new InvalidArgumentException(
                'Max length must be an integer.'
            );
        }

        if ($maxLength < 0) {
            throw new InvalidArgumentException(
                'Max length must be a positive integer (>=0).'
            );
        }

        $this->maxLength = $maxLength;

        return $this;
    }
258618
public function maxLength($len, $msg)
    {
        if(strlen(trim($this->_value)) > $len) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
239239
public static function trimToNull(string $value = null, int $maxLength = null)
    {
        if ($value === null) {
            return null;
        }

        // trim it
        $value = trim($value);

        if (!$value) {
            return null;
        }

        if ($maxLength === 0 || $maxLength === null) {
            return $value;
        }

        return substr($value, 0, $maxLength);
    }
1099589
public function deleteRange($key, $length) {
        $badKeys = [];

        for ($i = $key; $i < $key + $length; $i++) {
            array_push($badKeys, $i);
        }

        $this->_datas = array_diff_key($this->_datas, array_flip($badKeys));
        $this->_datas = array_values($this->_datas);
    }
1121584
protected function onAttrChanged(string $key, $oldValue, $newValue)
	{
		$this->getGraph()->edgeAttrChanged($this, $key, $oldValue, $newValue);
	}
196967
protected function max($key, $length)
    {
        $conCate = '';
        $columnName = ucfirst($this->convertToFieldName($key)).' should be ';
        if (isset($this->errors[$key.self::ERROR])) {
            $conCate = str_replace('.', '', $this->errors[$key.self::ERROR]).' and ';
            $columnName = '';
        }

        if (mb_strlen($this->param[$key]) <= $length) {
            $this->errors[$key.self::ERROR] =
                $conCate.$columnName.'maximum '.$length.' characters.';

            return false;
        }

        return true;
    }
203691
public function setMax($max)
    {
        if (null === $max) {
            $this->_max = null;
        } else if ($max < $this->_min) {
            /**
             * @see Zend_Validate_Exception
             */
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception(
                "The maximum must be greater than or equal to the minimum length, but "
                . "$max < $this->_min"
            );
        } else {
            $this->_max = (integer) $max;
        }

        return $this;
    }
200611
public function rule_max( $key, $value, $max )
	{
		return $this->rule_max_num( $key, strlen( $value ), $max );
	}
405084
public function minLength($key, $minLength, $message = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $name) {
                $this->minLength($name, is_array($minLength) ? $minLength[$k] : $minLength, $message);
            }
        } else {
            if (isset($this->scope[$key]) && mb_strlen($this->scope[$key]) < $minLength) {
                $this->errors[$key] = sprintf($message !== null ? $message : self::$minLengthMessage, $key, $minLength);
            }
        }

        return $this;
    }
466392
public function retriesLeft($key, $maxAttempts)
    {
        $attempts = $this->attempts($key);

        return ($attempts === 0) ? $maxAttempts : $maxAttempts - $attempts + 1;
    }
1361662
public function isValid($mixValue){
		if(is_string($mixValue)){
			if($this->hasOption('min')){
				if(mb_strlen($mixValue)<$this->options()->min){
					throw new LengthException($mixValue, $this->options()->min, $this->options()->max);
					return false;
				}
			}
			if($this->hasOption('max')){
				if(mb_strlen($mixValue)>$this->options()->max){
					throw new LengthException($mixValue, $this->options()->min, $this->options()->max);
					return false;
				}
			}
			return true;
		}
		return false;
	}
308886
public static function isString($var, $minLenght = false, $maxLenght = false) {
        if (!is_string($var))
            return false;
        if ($minLenght && strlen($var) < $minLenght)
            return false;
        if ($maxLenght && strlen($var) > $maxLenght)
            return false;
        return true;
    }
886709
def _validate_maxlength(self, max_length, field, value):
        
        if isinstance(value, Iterable) and len(value) > max_length:
            self._error(field, errors.MAX_LENGTH, len(value))
242097
protected function sizeBetween($lengthValue, $min, $max, $not = true)
    {
        if (!($lengthValue <= $max && $lengthValue >= $min) && $not) {
            $this->addReturn('image_dimensions_width', 'width', [
                ':min' => $min,
                ':max' => $max
            ]);
        } elseif ($lengthValue <= $max && $lengthValue >= $min && !$not) {
            $this->addReturn('image_dimensions_width', 'not_width', [
                ':min' => $min,
                ':max' => $max
            ]);
        }
    }
486723
public function setMaxlength($maxlength)
    {
        if (empty((int) $maxlength)) {
            Throw new HtmlException('A html form textareas maxlength attribute needs to be of type integer.');
        }

        $this->attribute['maxlength'] = $maxlength;

        return $this;
    }
447656
public function setMaxvalueHeight($maxvalue_height){
        if(!is_int($maxvalue_height)){
            throw new \Exception("Falscher Dateityp (".gettype($maxvalue_height).") integer expected!");
        }
        $this->maxvalue_height = $maxvalue_height;
        return true;
    }