Skip to content

Conversation

@rmccue
Copy link
Member

@rmccue rmccue commented Feb 21, 2024

Fixes #313.

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

@rmccue
Copy link
Member Author

rmccue commented Feb 21, 2024

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
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?

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
Copy link
Contributor

tomjn commented Jul 2, 2024

@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
Contributor

@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.

"type": "phpcodesniffer-standard",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.1",
Copy link
Contributor

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
Copy link
Contributor

tomjn commented Dec 18, 2025

@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
Copy link
Contributor

tomjn commented Dec 18, 2025

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

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

6 participants