protected function setMaxLength(Field & $field, $length)
    {
        if (($value = intval($length)) > 0) {
            $field->validationRules[] = sprintf('max:%s', $value);
            $field->methodParams[] = $value;
        }

        return $this;
    }