Source

trekel / src / php / Trekel / Node / Selector / Sibling.php

<?php

class Trekel_Node_Selector_Sibling extends Trekel_Node_Selector {

  public function reduce ($node, $idx) {
    $this->initMatches();
    if ($parent = $node->getParent()) {
      $children = $parent->getChildren();
      $hash = spl_object_hash($node);
      foreach ($children as $child) {
        if (spl_object_hash($child) != $hash) {
          $this->matchType($child);
        }
      }
    }
    return $this->getMatches();
  }

} // end Trekel_Node_Selector_Sibling