protected function getRulesAsArray($rules) {
        $rulesArray = (is_string($rules)) ? explode('|', $rules) : $rules;

        return array_map(function($rule) {
            if ($rule instanceof \Closure) {
                return $rule($this->field->getNameKey());
            }

            return $rule;
        }, $rulesArray);
    }
protected function getRulesAsArray($rules) {
        $rulesArray = (is_string($rules)) ? explode('|', $rules) : $rules;

        return array_map(function($rule) {
            if ($rule instanceof \Closure) {
                return $rule($this->field->getNameKey());
            }

            return $rule;
        }, $rulesArray);
    }
protected function getRulesAsArray ( $ rules ) { $ rulesArray = ( is_string ( $ rules ) ) ? explode ( '|' , $ rules ) : $ rules ; return array_map ( function ( $ rule ) { if ( $ rule instanceof \ Closure ) { return $ rule ( $ this -> field -> getNameKey ( ) ) ; } return $ rule ; } , $ rulesArray ) ; }
Parse field rules as array and initialize closure rules

@param string|array $rules
@return array
Parse field rules as array and initialize closure rules