You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #1061 (split wp-cache.php into inc/ files, PR #1065 / ADR-0001).
Background
The split relocated legacy procedural clusters verbatim (pure move, no behaviour change). Each relocated file carries pre-existing WPCS debt — loose comparisons (==/!=), non-strict in_array/array_search, missing escaping, legacy spacing, etc. To keep the move behaviour-preserving and the PR lint-clean, those files are excluded from PHPCS in .phpcs.xml.dist:
inc/plugins-cookies.php
inc/cache-files.php
inc/htaccess.php
inc/settings-forms.php
inc/preload.php
inc/lifecycle.php
inc/admin-notices.php
inc/admin-ui.php
(inc/boost.php and newly authored files are not excluded and stay fully linted.)
Goal
Modernize each excluded file to satisfy the repo's .phpcs.xml.dist standard, then remove its exclude-pattern so it is linted again.
Constraints
Behaviour-preserving. Several flagged rules are not cosmetic — ==→===, non-strict in_array/array_search, and @-silencing changes can alter behaviour. Verify each change against the test net (composer test-php, make test-integration, composer test-e2e) rather than blanket-applying phpcbf.
Do it one file per PR/commit so each is reviewable and revertable, and so the changed-lines linter stays manageable.
Global-state reduction / class extraction (that's the deeper follow-up, e.g. turning inc/preload.php into the #1047 item-5 preload state machine). This issue is WPCS cleanup only.
Follow-up to #1061 (split
wp-cache.phpintoinc/files, PR #1065 / ADR-0001).Background
The split relocated legacy procedural clusters verbatim (pure move, no behaviour change). Each relocated file carries pre-existing WPCS debt — loose comparisons (
==/!=), non-strictin_array/array_search, missing escaping, legacy spacing, etc. To keep the move behaviour-preserving and the PR lint-clean, those files are excluded from PHPCS in.phpcs.xml.dist:inc/plugins-cookies.phpinc/cache-files.phpinc/htaccess.phpinc/settings-forms.phpinc/preload.phpinc/lifecycle.phpinc/admin-notices.phpinc/admin-ui.php(
inc/boost.phpand newly authored files are not excluded and stay fully linted.)Goal
Modernize each excluded file to satisfy the repo's
.phpcs.xml.diststandard, then remove itsexclude-patternso it is linted again.Constraints
==→===, non-strictin_array/array_search, and@-silencing changes can alter behaviour. Verify each change against the test net (composer test-php,make test-integration,composer test-e2e) rather than blanket-applyingphpcbf.phpcson these big procedural files aborts on a pre-existing PHPCompatibilityInternal.Exception; run it withphp -d error_reporting='E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED'to get the sniff list (see how Refactor: split wp-cache.php into per-responsibility inc/ files (pure move, test-net first) #1061 surfaced them).Out of scope
Global-state reduction / class extraction (that's the deeper follow-up, e.g. turning
inc/preload.phpinto the #1047 item-5 preload state machine). This issue is WPCS cleanup only.