symfony/dom-crawler
58.1
Adequate · 19 September 2026
2.5k
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is the Symfony DomCrawler library, a PHP component designed for parsing and interacting with HTML and XML documents. It provides capabilities for navigating the DOM, resolving URIs, and extracting data from links, images, and complex form fields. The system also includes specialized PHPUnit constraints to facilitate granular assertions when testing web application interfaces.
Behavioural changes
DomCrawler component refactored with modern PHP features and new URI resolution logic
The DomCrawler component has been significantly refactored to use modern PHP 8+ features, including constructor property promotion, native type declarations, and the removal of the legacy SplObjectStorage inheritance in favor of a native array-based node list. A new UriResolver class and AbstractUriElement base class centralize URI resolution logic, improving how relative links and form actions are handled against a base URI. The Form class now extends Link to share this URI logic and uses a new internal FormFieldRegistry to manage complex multi-dimensional form fields. Additionally, the component now supports \<area\> and \<link\> tags as navigable links, allows selecting images via new methods, and enforces stricter security by disabling external entity loading in XML parsing.
(repo-wide) · high confidence
Enhanced form field handling and API modernization in DomCrawler
This update modernizes the DomCrawler form field classes with strict PHP types and improved behavior. ChoiceFormField now supports selecting options by visible text via the new selectByText() method and correctly identifies disabled options. FileFormField upload logic has been updated to preserve file extensions in temporary copies, and InputFormField now recognizes \<button\> elements. Additionally, FormField gains a getLabel() method to retrieve associated labels, and all classes have been refactored with native return types and strict comparisons.
Field · high confidence
Test coverage
Added test fixtures for Alpine.js, encoding, and file extension handling; Added tests for DomCrawler assertion constraints; Added unit tests for DomCrawler components; Added unit tests for DomCrawler form field classes; New DOM Crawler test constraints for selector assertions.
Dependencies
Initial composer.json for Symfony DomCrawler
Added a composer.json manifest for the Symfony DomCrawler library, defining it as a PSR-4 autoloaded package with a minimum PHP requirement of 8.4.1 and dependencies on symfony/polyfill-ctype and symfony/polyfill-mbstring, while listing symfony/css-selector as a development dependency.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 58.
Lenses
- Code Health 96
- Architecture 100
- Maturity 46
- Readiness 43
- Security 100
Changes since last survey
- 300 commits — 264 feature/other, 36 fixes
By area
- (repo) — 164 commits
- (root) — 86 commits
- Test/Constraint — 11 commits
- Tests/AbstractCrawlerTestCase.php — 6 commits
- Tests/AbstractCrawlerTest.php — 5 commits
- Tests/FormTest.php — 5 commits
- Tests/Html5ParserCrawlerTest.php — 5 commits
- Field/ChoiceFormField.php — 4 commits
- Field/FileFormField.php — 2 commits
- Tests/CrawlerTest.php — 2 commits
- Tests/Field — 2 commits
- Tests/NativeParserCrawlerTest.php — 2 commits
- .github/PULL_REQUEST_TEMPLATE.md — 1 commit
- Field/FormField.php — 1 commit
- Field/TextareaFormField.php — 1 commit
- Tests/CrawlerTestCase.php — 1 commit
- Tests/LegacyParserCrawlerTest.php — 1 commit
- Tests/Test — 1 commit
Notable commits
- fix: Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
- fix: CS fixes
- fix: CS fixes
- fix: CS fixes
- fix: CS fixes - native_function_invocation & static_lambda
- fix: Fix Crawler::filter throw phpdoc
- fix: Fix deprecations on PHP 8.2
- fix: Fix more generic types
- fix: Fix multiple CS errors
- fix: Minor fixes around parse_url() checks
- fix: More CS fixes
- fix: Revert "minor #54653 Auto-close PRs on subtree-splits (nicolas-grekas)"
- fix: Work around parse_url() bug
- fix: Work around parse_url() bug (bis)
- fix: [5.4] cs fixes
- fix: [6.0] cs fixes
- fix: [Crawler] Fix regression where cdata nodes will return empty string
- fix: [DomCrawler] Fix FormField::getLabel() when the field id contains a quote
- fix: [DomCrawler] Fix HTML5 parser charset option
- fix: [DomCrawler] Fix XXE in addXmlContent() by not enabling validateOnParse
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
symfony/dom-crawler was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 0a1832b64f19951888d9d642086195a67146e904 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.