Example #1
0
 /**
  * Searches the current node list for the position of a specific node.
  *
  * @param DomNode $subject Node to search for
  * @return int Offset of the node starting from 0, or null if the node is
  *             not found
  */
 public function index(DomNode $subject)
 {
     foreach ($this as $key => $node) {
         if ($subject->isSameNode($node)) {
             return $key;
         }
     }
     return null;
 }