Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Crawler.php

function Crawler::sibling

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 1049

Class

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

Namespace

Symfony\Component\DomCrawler

Code

protected function sibling(\DOMNode $node, string $siblingDir = 'nextSibling') : array {
    $nodes = [];
    $currentNode = $this->getNode(0);
    do {
        if ($node !== $currentNode && \XML_ELEMENT_NODE === $node->nodeType) {
            $nodes[] = $node;
        }
    } while ($node = $node->{$siblingDir});
    return $nodes;
}
RSS feed
Powered by Drupal