You are here

protected function Crawler::sibling in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Crawler.php \Symfony\Component\DomCrawler\Crawler::sibling()

Parameters

\DOMElement $node:

string $siblingDir:

Return value

array

4 calls to Crawler::sibling()
Crawler::children in vendor/symfony/dom-crawler/Crawler.php
Returns the children nodes of the current selection.
Crawler::nextAll in vendor/symfony/dom-crawler/Crawler.php
Returns the next siblings nodes of the current selection.
Crawler::previousAll in vendor/symfony/dom-crawler/Crawler.php
Returns the previous sibling nodes of the current selection.
Crawler::siblings in vendor/symfony/dom-crawler/Crawler.php
Returns the siblings nodes of the current selection.

File

vendor/symfony/dom-crawler/Crawler.php, line 932

Class

Crawler
Crawler eases navigation of a list of \DOMElement objects.

Namespace

Symfony\Component\DomCrawler

Code

protected function sibling($node, $siblingDir = 'nextSibling') {
  $nodes = array();
  do {
    if ($node !== $this
      ->getNode(0) && $node->nodeType === 1) {
      $nodes[] = $node;
    }
  } while ($node = $node->{$siblingDir});
  return $nodes;
}