original_string: public function augment($data)
      {
          // initialize
          $this[self::KEY_AUGMENTED] = [];
          // get rules
          $rulekeys = array_filter($this->keys(), function($key) {
              return strpos($key, self::PREFIX_RULE) === 0;
          });
          // apply rules
          foreach ($rulekeys as $rulename) {
              $augmentation_step = $this[$rulename]($this, $data);
              if (!is_array($augmentation_step)) {
                  throw new \RuntimeException("augmentaion rule '$rulename' did not produce data. Make sure to return the array of augmented data.");
              }
              // make the augmented data so far available to the next rule
              $this[self::KEY_AUGMENTED] = array_merge($this[self::KEY_AUGMENTED], $augmentation_step);
          }
          $this->checkAugmented();
  
          if ($this->hasColumnOrderSpecification()) {
              $result = [];
              foreach ($this[self::KEY_COLOUMN_ORDER] as $key) {
                  $result[$key] = $this[self::KEY_AUGMENTED][$key];
              }
              return $result;
          } else {
              return $this[self::KEY_AUGMENTED];
          }
      }
code: public function augment($data)
      {
          // initialize
          $this[self::KEY_AUGMENTED] = [];
          // get rules
          $rulekeys = array_filter($this->keys(), function($key) {
              return strpos($key, self::PREFIX_RULE) === 0;
          });
          // apply rules
          foreach ($rulekeys as $rulename) {
              $augmentation_step = $this[$rulename]($this, $data);
              if (!is_array($augmentation_step)) {
                  throw new \RuntimeException("augmentaion rule '$rulename' did not produce data. Make sure to return the array of augmented data.");
              }
              // make the augmented data so far available to the next rule
              $this[self::KEY_AUGMENTED] = array_merge($this[self::KEY_AUGMENTED], $augmentation_step);
          }
          $this->checkAugmented();
  
          if ($this->hasColumnOrderSpecification()) {
              $result = [];
              foreach ($this[self::KEY_COLOUMN_ORDER] as $key) {
                  $result[$key] = $this[self::KEY_AUGMENTED][$key];
              }
              return $result;
          } else {
              return $this[self::KEY_AUGMENTED];
          }
      }
code_tokens: public function augment ( $ data ) { // initialize $ this [ self :: KEY_AUGMENTED ] = [ ] ; // get rules $ rulekeys = array_filter ( $ this -> keys ( ) , function ( $ key ) { return strpos ( $ key , self :: PREFIX_RULE ) === 0 ; } ) ; // apply rules foreach ( $ rulekeys as $ rulename ) { $ augmentation_step = $ this [ $ rulename ] ( $ this , $ data ) ; if ( ! is_array ( $ augmentation_step ) ) { throw new \ RuntimeException ( "augmentaion rule '$rulename' did not produce data. Make sure to return the array of augmented data." ) ; } // make the augmented data so far available to the next rule $ this [ self :: KEY_AUGMENTED ] = array_merge ( $ this [ self :: KEY_AUGMENTED ] , $ augmentation_step ) ; } $ this -> checkAugmented ( ) ; if ( $ this -> hasColumnOrderSpecification ( ) ) { $ result = [ ] ; foreach ( $ this [ self :: KEY_COLOUMN_ORDER ] as $ key ) { $ result [ $ key ] = $ this [ self :: KEY_AUGMENTED ] [ $ key ] ; } return $ result ; } else { return $ this [ self :: KEY_AUGMENTED ] ; } }
docstring: Augment data according to the rules and return the result.
  
  @param array $data contains the data of the current row.
  
  @return array the original data (left unchanged) and the augmented data.
docstring_tokens: Augment data according to the rules and return the result .