Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade wpcs #314

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Upgrade wpcs #314

wants to merge 9 commits into from

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`.
@@ -14,6 +14,7 @@
*
* @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to WPCS v3
3 participants