original_string: protected function _getMergeRule($element, &$affected = null, $rule = null)
      {
          if ($rule instanceof MergeRuleInterface) {
              $result = $rule($this, $element, $affected);
  
              if ($result !== false) {
                  return $result;
              }
          }
  
          $name = $element->getName();
          if (isset($this->{$name})) {
              $affected = $this->{$name};
              return self::MERGE_REPLACE;
          }
  
          return self::MERGE_APPEND;
      }
code: protected function _getMergeRule($element, &$affected = null, $rule = null)
      {
          if ($rule instanceof MergeRuleInterface) {
              $result = $rule($this, $element, $affected);
  
              if ($result !== false) {
                  return $result;
              }
          }
  
          $name = $element->getName();
          if (isset($this->{$name})) {
              $affected = $this->{$name};
              return self::MERGE_REPLACE;
          }
  
          return self::MERGE_APPEND;
      }
code_tokens: protected function _getMergeRule ( $ element , & $ affected = null , $ rule = null ) { if ( $ rule instanceof MergeRuleInterface ) { $ result = $ rule ( $ this , $ element , $ affected ) ; if ( $ result !== false ) { return $ result ; } } $ name = $ element -> getName ( ) ; if ( isset ( $ this -> { $ name } ) ) { $ affected = $ this -> { $ name } ; return self :: MERGE_REPLACE ; } return self :: MERGE_APPEND ; }
docstring: find merge rule
  
  @param \rampage\core\xml\SimpleXmlElement $element
  @param \rampage\core\xml\SimpleXmlElement $affected
  @return int
docstring_tokens: find merge rule