original_string: public function formatQueryResult(QueryResultInterface $result, OutputInterface $output, $elapsed)
      {
          $table = new Table($output);
          $table->setHeaders(array_merge([
              'Path',
          ], $result->getColumnNames()));
  
          foreach ($result->getRows() as $row) {
              $values = array_merge([
                  $row->getPath(),
              ], $row->getValues());
  
              foreach ($values as &$value) {
                  if ($value instanceof \DateTime) {
                      $value = $value->format('c');
                      continue;
                  }
  
                  $value = $this->textHelper->truncate($value, 255);
              }
  
              $table->addRow($values);
          }
  
          $table->render($output);
  
          if (true === $this->config['show_execution_time_query']) {
              $output->writeln(sprintf(
                  '%s rows in set (%s sec)',
                  count($result->getRows()),
                  number_format($elapsed, $this->config['execution_time_expansion']))
              );
          }
      }
code: public function formatQueryResult(QueryResultInterface $result, OutputInterface $output, $elapsed)
      {
          $table = new Table($output);
          $table->setHeaders(array_merge([
              'Path',
          ], $result->getColumnNames()));
  
          foreach ($result->getRows() as $row) {
              $values = array_merge([
                  $row->getPath(),
              ], $row->getValues());
  
              foreach ($values as &$value) {
                  if ($value instanceof \DateTime) {
                      $value = $value->format('c');
                      continue;
                  }
  
                  $value = $this->textHelper->truncate($value, 255);
              }
  
              $table->addRow($values);
          }
  
          $table->render($output);
  
          if (true === $this->config['show_execution_time_query']) {
              $output->writeln(sprintf(
                  '%s rows in set (%s sec)',
                  count($result->getRows()),
                  number_format($elapsed, $this->config['execution_time_expansion']))
              );
          }
      }
code_tokens: public function formatQueryResult ( QueryResultInterface $ result , OutputInterface $ output , $ elapsed ) { $ table = new Table ( $ output ) ; $ table -> setHeaders ( array_merge ( [ 'Path' , ] , $ result -> getColumnNames ( ) ) ) ; foreach ( $ result -> getRows ( ) as $ row ) { $ values = array_merge ( [ $ row -> getPath ( ) , ] , $ row -> getValues ( ) ) ; foreach ( $ values as & $ value ) { if ( $ value instanceof \ DateTime ) { $ value = $ value -> format ( 'c' ) ; continue ; } $ value = $ this -> textHelper -> truncate ( $ value , 255 ) ; } $ table -> addRow ( $ values ) ; } $ table -> render ( $ output ) ; if ( true === $ this -> config [ 'show_execution_time_query' ] ) { $ output -> writeln ( sprintf ( '%s rows in set (%s sec)' , count ( $ result -> getRows ( ) ) , number_format ( $ elapsed , $ this -> config [ 'execution_time_expansion' ] ) ) ) ; } }
docstring: Render a table with the results of the given QueryResultInterface.
docstring_tokens: Render a table with the results of the given QueryResultInterface .