original_string: public function mergeAttributes(SimpleXmlElement $node, $replace = true)
      {
          foreach ($node->attributes() as $name => $value) {
              if (isset($this[$name])) {
                  if ($replace) {
                      $this[$name] = (string)$value;
                  }
  
                  continue;
              }
  
              $this->addAttribute($name, (string)$value);
          }
  
          return $this;
      }
code: public function mergeAttributes(SimpleXmlElement $node, $replace = true)
      {
          foreach ($node->attributes() as $name => $value) {
              if (isset($this[$name])) {
                  if ($replace) {
                      $this[$name] = (string)$value;
                  }
  
                  continue;
              }
  
              $this->addAttribute($name, (string)$value);
          }
  
          return $this;
      }
code_tokens: public function mergeAttributes ( SimpleXmlElement $ node , $ replace = true ) { foreach ( $ node -> attributes ( ) as $ name => $ value ) { if ( isset ( $ this [ $ name ] ) ) { if ( $ replace ) { $ this [ $ name ] = ( string ) $ value ; } continue ; } $ this -> addAttribute ( $ name , ( string ) $ value ) ; } return $ this ; }
docstring: Merge attributes from the given node to this one
  
  @param \rampage\core\xml\SimpleXmlElement $node
  @param bool $replace
docstring_tokens: Merge attributes from the given node to this one