protected function getFirst($key)
    {
        foreach ($this->rules as $rule) {
            if (substr($rule, 0, strlen($key)) == $key) {
                $params = explode(':', $rule, 2);
                if (isset($params[1])) {
                    return intval($params[1]);
                }
            }
        }

        return '';
    }
protected function getFirst($key)
    {
        foreach ($this->rules as $rule) {
            if (substr($rule, 0, strlen($key)) == $key) {
                $params = explode(':', $rule, 2);
                if (isset($params[1])) {
                    return intval($params[1]);
                }
            }
        }

        return '';
    }
protected function getFirst ( $ key ) { foreach ( $ this -> rules as $ rule ) { if ( substr ( $ rule , 0 , strlen ( $ key ) ) == $ key ) { $ params = explode ( ':' , $ rule , 2 ) ; if ( isset ( $ params [ 1 ] ) ) { return intval ( $ params [ 1 ] ) ; } } } return '' ; }
Gets the first found key in the rules

@param string $key

@return bool
Gets the first found key in the rules