src/Validate.php
public static function uint($input, $min = 0, $max = null, $field_name = 'uint')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_UINT, Validate::REQUIRED]
        ];

        $model[$field_name]['min'] = $min;

        if ($max !== null) {
            $model[$field_name]['max'] = $max;
        }

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function uint($input, $min = 0, $max = null, $field_name = 'uint')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_UINT, Validate::REQUIRED]
        ];

        $model[$field_name]['min'] = $min;

        if ($max !== null) {
            $model[$field_name]['max'] = $max;
        }

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function uint ( $ input , $ min = 0 , $ max = null , $ field_name = 'uint' ) { //Define trivial model $ model = [ $ field_name => [ 'type' => Validate :: TYPE_UINT , Validate :: REQUIRED ] ] ; $ model [ $ field_name ] [ 'min' ] = $ min ; if ( $ max !== null ) { $ model [ $ field_name ] [ 'max' ] = $ max ; } $ parameters = [ $ field_name => $ input ] ; Validate :: model ( $ parameters , $ model ) ; return $ parameters [ $ field_name ] ; }
Validate an unsigned integer
@param string|integer $input Input value
@param integer $min Minimum value. Optional default is 0.
@param integer|null $max Maximum value. Optional default is NULL, if NULL then the maximum value is skipped
@param String $field_name Field's name, used in IncorrectParametersException. Optional default is uint
@throws IncorrectParameters If valu type is not correct.
@return integer Returns the value of the input value as int
Validate an unsigned integer