-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DomCrawler] Inconsistency between children and parents #26432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I suppose that these methods replicate the functionality of jQuery. The |
To be honest the current behaviour makes sense to me. It does say "children", not "descendants". |
@jakzal I agree for this one, but why "parents" and not "ancestors" then? |
In XPath, the terms are:
and
|
Do close here and create the issue in the doc repo or is there something todo in core ? |
Hey, thanks for your report! |
Friendly ping? Should this still be open? I will close if I don't hear anything. |
see #39684 |
…() (xabbuh) This PR was merged into the 5.3-dev branch. Discussion ---------- [DomCrawler] deprecate parents() in favor of ancestors() | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Fix #26432 | License | MIT | Doc PR | Commits ------- 8baafa2 deprecate parents() in favor of ancestors()
According to the documentation:
However,
children()
returns only direct children (not grandchildren...), whileparents()
returns all ancestors (including grandparents...).Maybe it's more a docs issue than a code issue? Anyway it looks weird to me that methods with similar names have a different behavior.
The text was updated successfully, but these errors were encountered: