original_string: private function add_result_item($name, $value) {
  
          $results = $this->task->get_results();
  
          if (isset($results[$name])) {
              if (!is_array($results[$name])) {
                  throw new coding_exception('Unable to append a result item into a non-array structure.');
              }
              $current = $results[$name];
              $current[] = $value;
              $this->task->add_result(array($name => $current));
  
          } else {
              $this->task->add_result(array($name => array($value)));
          }
      }
code: private function add_result_item($name, $value) {
  
          $results = $this->task->get_results();
  
          if (isset($results[$name])) {
              if (!is_array($results[$name])) {
                  throw new coding_exception('Unable to append a result item into a non-array structure.');
              }
              $current = $results[$name];
              $current[] = $value;
              $this->task->add_result(array($name => $current));
  
          } else {
              $this->task->add_result(array($name => array($value)));
          }
      }
code_tokens: private function add_result_item ( $ name , $ value ) { $ results = $ this -> task -> get_results ( ) ; if ( isset ( $ results [ $ name ] ) ) { if ( ! is_array ( $ results [ $ name ] ) ) { throw new coding_exception ( 'Unable to append a result item into a non-array structure.' ) ; } $ current = $ results [ $ name ] ; $ current [ ] = $ value ; $ this -> task -> add_result ( array ( $ name => $ current ) ) ; } else { $ this -> task -> add_result ( array ( $ name => array ( $ value ) ) ) ; } }
docstring: Append a value to the given resultset
  
  @param string $name name of the result containing a list of values
  @param mixed $value value to add as another item in that result
docstring_tokens: Append a value to the given resultset