original_string: public function getErrorMessages()
      {
          $errors = [];
          foreach ($this->fields as $field) {
              if ($field instanceof AbstractFormField && !$field->isValid()) {
                  $fldErrors = $field->getErrorMessages();
                  $errors = array_merge($errors, $fldErrors);
              }
          }
  
          return $errors;
      }
code: public function getErrorMessages()
      {
          $errors = [];
          foreach ($this->fields as $field) {
              if ($field instanceof AbstractFormField && !$field->isValid()) {
                  $fldErrors = $field->getErrorMessages();
                  $errors = array_merge($errors, $fldErrors);
              }
          }
  
          return $errors;
      }
code_tokens: public function getErrorMessages ( ) { $ errors = [ ] ; foreach ( $ this -> fields as $ field ) { if ( $ field instanceof AbstractFormField && ! $ field -> isValid ( ) ) { $ fldErrors = $ field -> getErrorMessages ( ) ; $ errors = array_merge ( $ errors , $ fldErrors ) ; } } return $ errors ; }
docstring: Fetch all error messages for fields
  
  @return array
docstring_tokens: Fetch all error messages for fields