lithium\util\Validator::__callStatic PHP Method

__callStatic() public static method

Maps method calls to validation rule names. For example, a validation rule that would normally be called as Validator::rule('email', '[email protected]') can also be called as Validator::isEmail('[email protected]').
public static __callStatic ( string $method, array $args = [] ) : boolean
$method string The name of the method called, i.e. `'isEmail'` or `'isCreditCard'`.
$args array
return boolean
    public static function __callStatic($method, $args = array())
    {
        if (!isset($args[0])) {
            return false;
        }
        $args = array_filter($args) + array(0 => $args[0], 1 => 'any', 2 => array());
        $rule = preg_replace("/^is([A-Z][A-Za-z0-9]+)\$/", '$1', $method);
        $rule[0] = strtolower($rule[0]);
        return static::rule($rule, $args[0], $args[1], $args[2]);
    }