Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review comments remain, and all reviewed changes are approval-ready.
Pull request overview
This test-only PR modernizes default initialization with PHP’s null coalescing assignment operator (??=).
Changes:
- Updates PHPUnit tests and shared infrastructure.
- Modernizes PHPStan hook documentation caching.
- Leaves production code unchanged.
File summaries
| File | Description |
|---|---|
tests/phpunit/tests/wp-token-map/wpTokenMap.php |
Modernizes token-map caching. |
tests/phpunit/tests/url.php |
Modernizes global post initialization. |
tests/phpunit/tests/rest-api/rest-schema-validation.php |
Modernizes schema defaults. |
tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php |
Modernizes dataset caching. |
tests/phpunit/tests/blocks/registerCoreBlockStyleHandles.php |
Modernizes block style defaults. |
tests/phpunit/tests/blocks/register.php |
Modernizes block metadata defaults. |
tests/phpunit/tests/admin/plugin-dependencies/base.php |
Modernizes reflection caching. |
tests/phpunit/includes/utils.php |
Modernizes parser and filter defaults. |
tests/phpunit/includes/factory/class-wp-unittest-factory-for-thing.php |
Modernizes factory defaults. |
tests/phpunit/includes/class-wp-test-stream.php |
Modernizes stream data initialization. |
tests/phpunit/includes/class-wp-phpunit-timing-metrics.php |
Modernizes timing fallback logic. |
tests/phpunit/includes/abstract-testcase.php |
Modernizes URL query initialization. |
tests/phpstan/HookDocBlock.php |
Modernizes hook documentation caches. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…test suite. Replaces the “assign a default only if not already set” guard blocks in the PHPUnit test suite, the shared test infrastructure and the PHPStan hook docblock helper with the null coalescing assignment operator (`??=`). Developed in #13511. Props Soean, westonruter. See #65823. git-svn-id: https://develop.svn.wordpress.org/trunk@63633 602fd350-edb4-49c9-b593-d223f7449a82
…test suite. Replaces the “assign a default only if not already set” guard blocks in the PHPUnit test suite, the shared test infrastructure and the PHPStan hook docblock helper with the null coalescing assignment operator (`??=`). Developed in WordPress/wordpress-develop#13511. Props Soean, westonruter. See #65823. Built from https://develop.svn.wordpress.org/trunk@63633 git-svn-id: http://core.svn.wordpress.org/trunk@62808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
Thanks for the PR! Merged in r63633. |
Replaces the "assign a default only if not already set" guard blocks in the PHPUnit test suite, the shared test infrastructure and the PHPStan hook docblock helper with the null coalescing assignment operator (
??=).Scope
Each touched file is converted completely: every guard that
??=can express is converted, so no file is left half-modernized.The same pattern exists throughout
src/; that is left for separate follow-ups on the same ticket so each one stays reviewable. This PR is test-only, which makes it independent of the others in the series.Trac ticket: https://core.trac.wordpress.org/ticket/65823
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.