original_string: private function generateTree($data, $total_depth, $current_depth = 1) {
          ksort($data);
  
          $table = [];
  
          foreach ($data as $key => $value) {
              $row = [];
              if ($current_depth > 1) {
                  $row = array_merge($row, array_fill(0, ($current_depth - 1), ''));
              }
  
              $row[] = '<comment>' . $key . '</comment>';
              if (!is_array($value)) {
                  $row[] = (is_bool($value)) ? (($value) ? 'true' : 'false') : $value;
              }
  
              // Pad the row out with empty columns equal to the total subtracting the current recursive depth.
              $empty_columns = ($total_depth - $current_depth);
              $empty_columns = array_fill(count($row) - 1, $empty_columns, '');
              $row = array_merge($row, $empty_columns);
  
              $table[] = $row;
  
              if (is_array($value)) {
                  $table = array_merge($table, $this->generateTree($value, $total_depth, $current_depth + 1));
              }
          }
  
          return $table;
      }
code: private function generateTree($data, $total_depth, $current_depth = 1) {
          ksort($data);
  
          $table = [];
  
          foreach ($data as $key => $value) {
              $row = [];
              if ($current_depth > 1) {
                  $row = array_merge($row, array_fill(0, ($current_depth - 1), ''));
              }
  
              $row[] = '<comment>' . $key . '</comment>';
              if (!is_array($value)) {
                  $row[] = (is_bool($value)) ? (($value) ? 'true' : 'false') : $value;
              }
  
              // Pad the row out with empty columns equal to the total subtracting the current recursive depth.
              $empty_columns = ($total_depth - $current_depth);
              $empty_columns = array_fill(count($row) - 1, $empty_columns, '');
              $row = array_merge($row, $empty_columns);
  
              $table[] = $row;
  
              if (is_array($value)) {
                  $table = array_merge($table, $this->generateTree($value, $total_depth, $current_depth + 1));
              }
          }
  
          return $table;
      }
code_tokens: private function generateTree ( $ data , $ total_depth , $ current_depth = 1 ) { ksort ( $ data ) ; $ table = [ ] ; foreach ( $ data as $ key => $ value ) { $ row = [ ] ; if ( $ current_depth > 1 ) { $ row = array_merge ( $ row , array_fill ( 0 , ( $ current_depth - 1 ) , '' ) ) ; } $ row [ ] = '<comment>' . $ key . '</comment>' ; if ( ! is_array ( $ value ) ) { $ row [ ] = ( is_bool ( $ value ) ) ? ( ( $ value ) ? 'true' : 'false' ) : $ value ; } // Pad the row out with empty columns equal to the total subtracting the current recursive depth. $ empty_columns = ( $ total_depth - $ current_depth ) ; $ empty_columns = array_fill ( count ( $ row ) - 1 , $ empty_columns , '' ) ; $ row = array_merge ( $ row , $ empty_columns ) ; $ table [ ] = $ row ; if ( is_array ( $ value ) ) { $ table = array_merge ( $ table , $ this -> generateTree ( $ value , $ total_depth , $ current_depth + 1 ) ) ; } } return $ table ; }
docstring: Take a configuration array, recursively traverse and create a padded tree array to output as a table.
  @param  array   $data
  @param  integer $total_depth
  @param  integer $current_depth
  @return array
docstring_tokens: Take a configuration array recursively traverse and create a padded tree array to output as a table .