original_string: private static function dumpTree(NodeInterface $node, $verbose, $indent = 0)
      {
          list($attributes, $nodes) = self::extract($node);
  
          $dump = get_class($node);
  
          if ($attributes) {
              $dump .= ' (';
  
              $dump .= implode(', ', array_map(
                  function ($key, $value) use ($verbose) {
                      return ($verbose ? sprintf('%s = ', $key) : '').self::stringify($value);
                  },
                  array_keys($attributes),
                  array_values($attributes)
              ));
  
              $dump .= ')';
          }
  
          if ($nodes) {
              $dump .= ' {'.PHP_EOL;
  
              foreach ($nodes as $key => $node) {
                  $dump .= str_repeat('  ', $indent + 1);
  
                  if ($verbose && is_string($key)) {
                      $dump .= sprintf('%s = ', $key);
                  }
  
                  if (is_array($node)) {
                      $dump .= '['.PHP_EOL;
  
                      foreach ($node as $item) {
                          $dump .= str_repeat('  ', $indent + 2).self::dumpTree($item, $verbose, $indent + 2).PHP_EOL;
                      }
  
                      $dump .= str_repeat('  ', $indent + 1).']'.PHP_EOL;
                  } else {
                      $dump .= self::dumpTree($node, $verbose, $indent + 1).PHP_EOL;
                  }
              }
  
              $dump .= str_repeat('  ', $indent).'}';
          }
  
          return $dump;
      }
code: private static function dumpTree(NodeInterface $node, $verbose, $indent = 0)
      {
          list($attributes, $nodes) = self::extract($node);
  
          $dump = get_class($node);
  
          if ($attributes) {
              $dump .= ' (';
  
              $dump .= implode(', ', array_map(
                  function ($key, $value) use ($verbose) {
                      return ($verbose ? sprintf('%s = ', $key) : '').self::stringify($value);
                  },
                  array_keys($attributes),
                  array_values($attributes)
              ));
  
              $dump .= ')';
          }
  
          if ($nodes) {
              $dump .= ' {'.PHP_EOL;
  
              foreach ($nodes as $key => $node) {
                  $dump .= str_repeat('  ', $indent + 1);
  
                  if ($verbose && is_string($key)) {
                      $dump .= sprintf('%s = ', $key);
                  }
  
                  if (is_array($node)) {
                      $dump .= '['.PHP_EOL;
  
                      foreach ($node as $item) {
                          $dump .= str_repeat('  ', $indent + 2).self::dumpTree($item, $verbose, $indent + 2).PHP_EOL;
                      }
  
                      $dump .= str_repeat('  ', $indent + 1).']'.PHP_EOL;
                  } else {
                      $dump .= self::dumpTree($node, $verbose, $indent + 1).PHP_EOL;
                  }
              }
  
              $dump .= str_repeat('  ', $indent).'}';
          }
  
          return $dump;
      }
code_tokens: private static function dumpTree ( NodeInterface $ node , $ verbose , $ indent = 0 ) { list ( $ attributes , $ nodes ) = self :: extract ( $ node ) ; $ dump = get_class ( $ node ) ; if ( $ attributes ) { $ dump .= ' (' ; $ dump .= implode ( ', ' , array_map ( function ( $ key , $ value ) use ( $ verbose ) { return ( $ verbose ? sprintf ( '%s = ' , $ key ) : '' ) . self :: stringify ( $ value ) ; } , array_keys ( $ attributes ) , array_values ( $ attributes ) ) ) ; $ dump .= ')' ; } if ( $ nodes ) { $ dump .= ' {' . PHP_EOL ; foreach ( $ nodes as $ key => $ node ) { $ dump .= str_repeat ( '  ' , $ indent + 1 ) ; if ( $ verbose && is_string ( $ key ) ) { $ dump .= sprintf ( '%s = ' , $ key ) ; } if ( is_array ( $ node ) ) { $ dump .= '[' . PHP_EOL ; foreach ( $ node as $ item ) { $ dump .= str_repeat ( '  ' , $ indent + 2 ) . self :: dumpTree ( $ item , $ verbose , $ indent + 2 ) . PHP_EOL ; } $ dump .= str_repeat ( '  ' , $ indent + 1 ) . ']' . PHP_EOL ; } else { $ dump .= self :: dumpTree ( $ node , $ verbose , $ indent + 1 ) . PHP_EOL ; } } $ dump .= str_repeat ( '  ' , $ indent ) . '}' ; } return $ dump ; }
docstring: Dumps the node and its children as a pretty printed string representation.
  
  @param NodeInterface $node    The root node to dump.
  @param bool          $verbose The dump will be more verbose if this flag is set to `true`.
  @param int           $indent  The indentation level to apply.
  
  @return string The dump of the node and its children.
docstring_tokens: Dumps the node and its children as a pretty printed string representation .