You are here

public function Crawler::siblings in Zircon Profile 8

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

Returns the siblings nodes of the current selection.

Return value

Crawler A Crawler instance with the sibling nodes

Throws

\InvalidArgumentException When current node is empty

File

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

Class

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

Namespace

Symfony\Component\DomCrawler

Code

public function siblings() {
  if (!count($this)) {
    throw new \InvalidArgumentException('The current node list is empty.');
  }
  return $this
    ->createSubCrawler($this
    ->sibling($this
    ->getNode(0)->parentNode->firstChild));
}