protected function getRuleType($rule)
    {
        if ( ! is_string($rule)) {
            return '';
        }

        if (false === ($pos = strpos($rule, ':'))) {
            return $rule;
        }

        return substr($rule, 0, $pos);
    }
protected function getRuleType($rule)
    {
        if ( ! is_string($rule)) {
            return '';
        }

        if (false === ($pos = strpos($rule, ':'))) {
            return $rule;
        }

        return substr($rule, 0, $pos);
    }
protected function getRuleType ( $ rule ) { if ( ! is_string ( $ rule ) ) { return '' ; } if ( false === ( $ pos = strpos ( $ rule , ':' ) ) ) { return $ rule ; } return substr ( $ rule , 0 , $ pos ) ; }
Returns a rule type for a given validation rule.

@param string $rule
@return string
Returns a rule type for a given validation rule .