src/Valitron/Validator.php
/**
     * Register new validation rule callback
     *
     * @param string $name
     * @param $callback
     * @param string $message
     * @throws \InvalidArgumentException
     */
Register new validation rule callback
@param string $name
@param $callback
@param string $message
@throws \InvalidArgumentException
Register new validation rule callback @param string $name @param $callback @param string $message @throws \ InvalidArgumentException
public static function addRule($name, $callback, $message = self::ERROR_DEFAULT)
    {
        if(!is_callable($callback)) {
            throw new \InvalidArgumentException("Second argument must be a valid callback. Given argument was not callable.");
        }
        static::$_rules[$name] = $callback;
        static::$_ruleMessages[$name] = $message;
    }
public static function addRule ( $ name , $ callback , $ message = self :: ERROR_DEFAULT ) { if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( " Second argument must be a valid callback. Given argument was not callable. " ) ; } static :: $ _rules [ $ name ] = $ callback ; static :: $ _ruleMessages [ $ name ] = $ message ; }
Register new validation rule callback
 @param string $name
 @param $callback
 @param string $message
 @throws \InvalidArgumentException
Register new validation rule callback @param string $name @param $callback @param string $message @throws \ InvalidArgumentException