original_string: protected function getFormFieldGeneratedRules($forCreate = true)
      {
          $this->generatedRulesMap = [];
          $rules                   = [];
  
          foreach ($this->info->form->fields as $field) {
  
              try {
                  $this->getFormFieldGeneratedRule($field, $forCreate, $rules);
  
              } catch (Exception $e) {
  
                  $section = 'form.validation.' . ($forCreate ? 'create' : 'update');
  
                  // Wrap and decorate exceptions so it is easier to track the problem source
                  throw (new ModelInformationEnrichmentException(
                      "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}",
                      $e->getCode(),
                      $e
                  ))
                      ->setSection($section)
                      ->setKey($field->key());
              }
          }
  
          return $rules;
      }
code: protected function getFormFieldGeneratedRules($forCreate = true)
      {
          $this->generatedRulesMap = [];
          $rules                   = [];
  
          foreach ($this->info->form->fields as $field) {
  
              try {
                  $this->getFormFieldGeneratedRule($field, $forCreate, $rules);
  
              } catch (Exception $e) {
  
                  $section = 'form.validation.' . ($forCreate ? 'create' : 'update');
  
                  // Wrap and decorate exceptions so it is easier to track the problem source
                  throw (new ModelInformationEnrichmentException(
                      "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}",
                      $e->getCode(),
                      $e
                  ))
                      ->setSection($section)
                      ->setKey($field->key());
              }
          }
  
          return $rules;
      }
code_tokens: protected function getFormFieldGeneratedRules ( $ forCreate = true ) { $ this -> generatedRulesMap = [ ] ; $ rules = [ ] ; foreach ( $ this -> info -> form -> fields as $ field ) { try { $ this -> getFormFieldGeneratedRule ( $ field , $ forCreate , $ rules ) ; } catch ( Exception $ e ) { $ section = 'form.validation.' . ( $ forCreate ? 'create' : 'update' ) ; // Wrap and decorate exceptions so it is easier to track the problem source throw ( new ModelInformationEnrichmentException ( "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}" , $ e -> getCode ( ) , $ e ) ) -> setSection ( $ section ) -> setKey ( $ field -> key ( ) ) ; } } return $ rules ; }
docstring: Returns rules determined by form field strategies.
  
  @param bool $forCreate
  @return array
  @throws ModelInformationEnrichmentException
docstring_tokens: Returns rules determined by form field strategies .