public static function addDefault()
    {
        static::$methods['null'] = function ($str) {
            return $str === null || $str === '';
        };
        static::$methods['len'] = function ($str, $min, $max = null) {
            $len = strlen($str);
            return null === $max ? $len === $min : $len >= $min && $len <= $max;
        };
        static::$methods['int'] = function ($str) {
            return (string)$str === ((string)(int)$str);
        };
        static::$methods['float'] = function ($str) {
            return (string)$str === ((string)(float)$str);
        };
        static::$methods['email'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_EMAIL) !== false;
        };
        static::$methods['url'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_URL) !== false;
        };
        static::$methods['ip'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_IP) !== false;
        };
        static::$methods['remoteip'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false;
        };
        static::$methods['alnum'] = function ($str) {
            return ctype_alnum($str);
        };
        static::$methods['alpha'] = function ($str) {
            return ctype_alpha($str);
        };
        static::$methods['contains'] = function ($str, $needle) {
            return strpos($str, $needle) !== false;
        };
        static::$methods['regex'] = function ($str, $pattern) {
            return preg_match($pattern, $str);
        };
        static::$methods['chars'] = function ($str, $chars) {
            return preg_match("/^[$chars]++$/i", $str);
        };

        static::$default_added = true;
    }
public static function addDefault()
    {
        static::$methods['null'] = function ($str) {
            return $str === null || $str === '';
        };
        static::$methods['len'] = function ($str, $min, $max = null) {
            $len = strlen($str);
            return null === $max ? $len === $min : $len >= $min && $len <= $max;
        };
        static::$methods['int'] = function ($str) {
            return (string)$str === ((string)(int)$str);
        };
        static::$methods['float'] = function ($str) {
            return (string)$str === ((string)(float)$str);
        };
        static::$methods['email'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_EMAIL) !== false;
        };
        static::$methods['url'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_URL) !== false;
        };
        static::$methods['ip'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_IP) !== false;
        };
        static::$methods['remoteip'] = function ($str) {
            return filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false;
        };
        static::$methods['alnum'] = function ($str) {
            return ctype_alnum($str);
        };
        static::$methods['alpha'] = function ($str) {
            return ctype_alpha($str);
        };
        static::$methods['contains'] = function ($str, $needle) {
            return strpos($str, $needle) !== false;
        };
        static::$methods['regex'] = function ($str, $pattern) {
            return preg_match($pattern, $str);
        };
        static::$methods['chars'] = function ($str, $chars) {
            return preg_match("/^[$chars]++$/i", $str);
        };

        static::$default_added = true;
    }
public static function addDefault ( ) { static :: $ methods [ 'null' ] = function ( $ str ) { return $ str === null || $ str === '' ; } ; static :: $ methods [ 'len' ] = function ( $ str , $ min , $ max = null ) { $ len = strlen ( $ str ) ; return null === $ max ? $ len === $ min : $ len >= $ min && $ len <= $ max ; } ; static :: $ methods [ 'int' ] = function ( $ str ) { return ( string ) $ str === ( ( string ) ( int ) $ str ) ; } ; static :: $ methods [ 'float' ] = function ( $ str ) { return ( string ) $ str === ( ( string ) ( float ) $ str ) ; } ; static :: $ methods [ 'email' ] = function ( $ str ) { return filter_var ( $ str , FILTER_VALIDATE_EMAIL ) !== false ; } ; static :: $ methods [ 'url' ] = function ( $ str ) { return filter_var ( $ str , FILTER_VALIDATE_URL ) !== false ; } ; static :: $ methods [ 'ip' ] = function ( $ str ) { return filter_var ( $ str , FILTER_VALIDATE_IP ) !== false ; } ; static :: $ methods [ 'remoteip' ] = function ( $ str ) { return filter_var ( $ str , FILTER_VALIDATE_IP , FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) !== false ; } ; static :: $ methods [ 'alnum' ] = function ( $ str ) { return ctype_alnum ( $ str ) ; } ; static :: $ methods [ 'alpha' ] = function ( $ str ) { return ctype_alpha ( $ str ) ; } ; static :: $ methods [ 'contains' ] = function ( $ str , $ needle ) { return strpos ( $ str , $ needle ) !== false ; } ; static :: $ methods [ 'regex' ] = function ( $ str , $ pattern ) { return preg_match ( $ pattern , $ str ) ; } ; static :: $ methods [ 'chars' ] = function ( $ str , $ chars ) { return preg_match ( "/^[$chars]++$/i" , $ str ) ; } ; static :: $ default_added = true ; }
Adds default validators on first use

@return void
Adds default validators on first use