From a496243c244019efef24cc223e31c829184053c2 Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Sun, 1 Jun 2025 16:13:16 +0200 Subject: [PATCH] [DomCrawler] Replace parents() by ancestors() --- testing/dom_crawler.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/dom_crawler.rst b/testing/dom_crawler.rst index 139d94efdd9..9d527304f96 100644 --- a/testing/dom_crawler.rst +++ b/testing/dom_crawler.rst @@ -10,11 +10,11 @@ Traversing Like jQuery, the Crawler has methods to traverse the DOM of an HTML/XML document. For example, the following finds all ``input[type=submit]`` elements, -selects the last one on the page, and then selects its immediate parent element:: +selects the last one on the page, and then selects its immediate ancestor element:: $newCrawler = $crawler->filter('input[type=submit]') ->last() - ->parents() + ->ancestors() ->first() ; @@ -36,8 +36,8 @@ Many other methods are also available: All following siblings. ``previousAll()`` All preceding siblings. -``parents()`` - Returns the parent nodes. +``ancestors()`` + Returns the ancestor nodes. ``children()`` Returns children nodes. ``reduce($lambda)``