original_string: public function walk() {
          if ($this->dom instanceof \DOMDocument) {
              $this->rules->document($this->dom);
          } elseif ($this->dom instanceof \DOMDocumentFragment) {
              // Document fragments are a special case. Only the children need to
              // be serialized.
              if ($this->dom->hasChildNodes()) {
                  $this->children($this->dom->childNodes);
              }
          }        // If NodeList, loop
          elseif ($this->dom instanceof \DOMNodeList) {
              // If this is a NodeList of DOMDocuments this will not work.
              $this->children($this->dom);
          }         // Else assume this is a DOMNode-like datastructure.
          else {
              $this->node($this->dom);
          }
  
          return $this->out;
      }
code: public function walk() {
          if ($this->dom instanceof \DOMDocument) {
              $this->rules->document($this->dom);
          } elseif ($this->dom instanceof \DOMDocumentFragment) {
              // Document fragments are a special case. Only the children need to
              // be serialized.
              if ($this->dom->hasChildNodes()) {
                  $this->children($this->dom->childNodes);
              }
          }        // If NodeList, loop
          elseif ($this->dom instanceof \DOMNodeList) {
              // If this is a NodeList of DOMDocuments this will not work.
              $this->children($this->dom);
          }         // Else assume this is a DOMNode-like datastructure.
          else {
              $this->node($this->dom);
          }
  
          return $this->out;
      }
code_tokens: public function walk ( ) { if ( $ this -> dom instanceof \ DOMDocument ) { $ this -> rules -> document ( $ this -> dom ) ; } elseif ( $ this -> dom instanceof \ DOMDocumentFragment ) { // Document fragments are a special case. Only the children need to // be serialized. if ( $ this -> dom -> hasChildNodes ( ) ) { $ this -> children ( $ this -> dom -> childNodes ) ; } } // If NodeList, loop elseif ( $ this -> dom instanceof \ DOMNodeList ) { // If this is a NodeList of DOMDocuments this will not work. $ this -> children ( $ this -> dom ) ; } // Else assume this is a DOMNode-like datastructure. else { $ this -> node ( $ this -> dom ) ; } return $ this -> out ; }
docstring: Tell the traverser to walk the DOM.
  
  @return resource $out
  Returns the output stream.
docstring_tokens: Tell the traverser to walk the DOM .