Skip to content

Upgrade wpcs#314

Merged
kadamwhite merged 15 commits into
masterfrom
upgrade-wpcs
Apr 27, 2026
Merged

Upgrade wpcs#314
kadamwhite merged 15 commits into
masterfrom
upgrade-wpcs

Conversation

@rmccue

@rmccue rmccue commented Feb 21, 2024

Copy link
Copy Markdown
Member

Fixes #313.

Have not exhaustively checked all the differences here yet to see what breaks.

@rmccue

rmccue commented Feb 21, 2024

Copy link
Copy Markdown
Member Author

Looks like the duplicate ignore checks may not be working as I think ::init was removed, but it's not fatalling when testing locally with Real Projects™️ at least.

rmccue and others added 6 commits February 21, 2024 20:12
These sniffs have been renamed upstream; I'm updating the ignore
refernces to them here to avoid errors parsing the HM ruleset.
`customPropertyWhitelist` has been renamed to `allowed_custom_properties`.
*
* @see https://github.com/WordPress/WordPress-Coding-Standards/issues/1864
*/
#[AllowDynamicProperties]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goldenapples Is this necessary? Seems like we should know the properties being used?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. Yeah, this was pretty hacky.

The problem is that $printingFunctions is changed in the parent class from protected to private, so trying to unset items from $this->printingFunctions here is not going to work, and will trigger an accessing dynamic properties warning.

foreach ( $this->hmSafePrintingFunctions as $function => $val ) {
unset( $this->printingFunctions[ $function ] );
}

This annotation silences the dynamic properties deprecation warning. It does not, however, make the code here work to ignore the safe printing functions.

@tomjn

tomjn commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

@rmccue @goldenapples is there work still pending on this? It's unclear what the status of the PR is currently, from first glances it looks like Travis CI is the blocker. This is causing an issue on a client repo so I'd like to scope out what needs doing so we can action it

@kadamwhite kadamwhite marked this pull request as ready for review September 19, 2025 19:49
@kadamwhite

Copy link
Copy Markdown
Collaborator

@tomjn I've been using this in production on a project via tracking the dev-upgrade-wpcs branch for several weeks with no issue. @rmccue @goldenapples I'd like to merge to get this landed and released, any objections? If not, I can forward with that next week.

Comment thread composer.json Outdated
@@ -5,8 +5,8 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we bump the PHP requirement?

Suggested change
"php": ">=7.1",
"php": ">=8.0",

@tomjn

tomjn commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

@kadamwhite I've been in a similar boat, from my POV the only blocker left for this is the failing Travis tests for a missing trait

@tomjn tomjn added the phpcs label Dec 18, 2025
@tomjn

tomjn commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

I tried updating PHPBasicAuth with this branch and ran into the PHPCompatibility trim error. There's a v10 alpha that should fix this but given that it's an alpha would we even consider including that here? I know some projects have patches that work around the problem but fundamentally there are language syntax differences only v10 can account for

https://github.com/PHPCompatibility/PHPCompatibility/wiki/Upgrading-to-PHPCompatibility-10.0#updating-your-custom-ruleset-and-phpcs-ignore-annotations

@kadamwhite

Copy link
Copy Markdown
Collaborator

@tomjn can you clarify how to reproduce the issue you're describing? I do not think we should be pinning an alpha, personally.

@tomjn

tomjn commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

@tomjn can you clarify how to reproduce the issue you're describing? I do not think we should be pinning an alpha, personally.

Likewise else I'd be adding commits, it seems that v10 coming out of alpha has a bit of a domino effect on downstream package releases. I forget where it was I was encountering this though

@kadamwhite kadamwhite merged commit fa5e3d0 into master Apr 27, 2026
2 checks passed
@kadamwhite kadamwhite deleted the upgrade-wpcs branch April 27, 2026 17:54
@rmccue

rmccue commented Apr 28, 2026

Copy link
Copy Markdown
Member Author

🚀 🚀 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to WPCS v3

5 participants