original_string: protected function getFileValidationRules()
      {
          $rules = array_get($this->field->options, 'validation', []);
  
          // If the 'image' rule is not set, make sure it is added.
          if (is_string($rules)) {
              if (empty($rules)) {
                  $rules = 'image';
              } elseif ( ! preg_match('#(^|\|)image($|\|)#', $rules)) {
                  $rules .= '|image';
              }
          } elseif ( ! in_array('image', $rules)) {
              array_unshift($rules, 'image');
          }
  
          return $rules;
      }
code: protected function getFileValidationRules()
      {
          $rules = array_get($this->field->options, 'validation', []);
  
          // If the 'image' rule is not set, make sure it is added.
          if (is_string($rules)) {
              if (empty($rules)) {
                  $rules = 'image';
              } elseif ( ! preg_match('#(^|\|)image($|\|)#', $rules)) {
                  $rules .= '|image';
              }
          } elseif ( ! in_array('image', $rules)) {
              array_unshift($rules, 'image');
          }
  
          return $rules;
      }
code_tokens: protected function getFileValidationRules ( ) { $ rules = array_get ( $ this -> field -> options , 'validation' , [ ] ) ; // If the 'image' rule is not set, make sure it is added. if ( is_string ( $ rules ) ) { if ( empty ( $ rules ) ) { $ rules = 'image' ; } elseif ( ! preg_match ( '#(^|\|)image($|\|)#' , $ rules ) ) { $ rules .= '|image' ; } } elseif ( ! in_array ( 'image' , $ rules ) ) { array_unshift ( $ rules , 'image' ) ; } return $ rules ; }
docstring: Returns validation rules that should be applied to the uploaded file.
  
  @return string|array
docstring_tokens: Returns validation rules that should be applied to the uploaded file .