Skip to content

Conversation

@justlevine
Copy link
Contributor

@justlevine justlevine commented Aug 13, 2025

What

This is a first pass of PHPStan/PHPCS remediations. Most were auto-fixed, a couple (like moving the file headers above the declare_strict() ),

Some tweaks to the phpcs.xml.dist as well, due to some accidental conflicts when I was deduping rulesets.

Follow up to #4

Remaining smells are:

  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound - do we want a namespace?
  • WordPress.WP.I18n.MissingArgDomain - do we want this translatable before merged into core?
  • Missing array shapes - I just didnt have time right now to review the APIs and add them it but this is easy to do.

And then some things that need actual remediation (using WP_Ability as a string) or a decision about if we want to suppress/fix/turn off the rule.

Why

  1. In its current shape, it incrementally remediates making the "noise smaller" (and the merge conflicts fewer)
  2. Lets us visually deliberate about rules we may or may not care about.

@justlevine justlevine force-pushed the chore/php-remediations branch from 29dc92f to c97f8bf Compare August 13, 2025 14:20
@justlevine justlevine force-pushed the chore/php-remediations branch from c97f8bf to d4af415 Compare August 13, 2025 14:21
@codecov
Copy link

codecov bot commented Aug 13, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

gziolo and others added 2 commits August 14, 2025 10:47
Co-authored-by: Dovid Levine <justlevine@gmail.com>
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

That's a nice improvement. We can address the rest of reported issues in follow-up PRs. I like how it helps to catch some small things in the code 💯

@gziolo gziolo merged commit c4e5fac into WordPress:trunk Aug 14, 2025
21 of 23 checks passed
@gziolo
Copy link
Member

gziolo commented Aug 14, 2025

And then some things that need actual remediation (using WP_Ability as a string) or a decision about if we want to suppress/fix/turn off the rule.

This was an actual error that I fixed in f762155.

@justlevine justlevine deleted the chore/php-remediations branch August 14, 2025 10:31
@gziolo gziolo added the [Tool] Issues related to development tooling, such as linting, testing, or CI label Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] Issues related to development tooling, such as linting, testing, or CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants