Skip to content

Remove obsolete get_term_by() PHPStan ignore entry - #651

Merged
swissspidy merged 1 commit into
mainfrom
fix/phpstan-unmatched-ignores
Aug 30, 2026
Merged

Remove obsolete get_term_by() PHPStan ignore entry#651
swissspidy merged 1 commit into
mainfrom
fix/phpstan-unmatched-ignores

Conversation

@swissspidy

@swissspidy swissspidy commented Aug 30, 2026

Copy link
Copy Markdown
Member

johnbillion/wp-compat 2.0.1 stopped reporting the $field parameter of get_term_by() as version-gated, fixing the false positive that the WPCompat.parameterNotAvailable.gettermby.field entry existed to suppress.

With nothing left to match, PHPStan now fails with a non-ignorable Ignored error pattern ... was not matched in reported errors, which is what broke the scheduled Code Quality run on main (run 33288290118). Removing the entry restores a clean analysis.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved static analysis coverage by enabling reporting for previously suppressed compatibility warnings.
    • No end-user functionality or behavior changes.

johnbillion/wp-compat 2.0.1 no longer reports the `$field` parameter of
get_term_by() as version-gated, so the ignore entry working around that
false positive is now unmatched and fails the analysis.
Copilot AI lite review requested due to automatic review settings August 30, 2026 07:15
@swissspidy
swissspidy requested a review from a team as a code owner August 30, 2026 07:15

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added bug scope:testing Related to testing labels Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5fa630dc-198a-406f-9daa-384ce5e3b17f

📥 Commits

Reviewing files that changed from the base of the PR and between 77d6472 and 33cd8a6.

📒 Files selected for processing (1)
  • phpstan.neon.dist
💤 Files with no reviewable changes (1)
  • phpstan.neon.dist

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The PHPStan configuration removes an ignore rule for WPCompat.parameterNotAvailable.gettermby.field. The rule previously excluded three command files from this check.

Changes

PHPStan validation

Layer / File(s) Summary
Remove get_term_by() ignore rule
phpstan.neon.dist
Removes the rule that suppressed the $field parameter check for src/Menu_Item_Command.php, src/Term_Command.php, and src/WP_CLI/CommandWithTerms.php.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 33cd8

This removes an obsolete PHPStan ignore entry so code-quality analysis can complete without the unmatched-pattern failure. The change is localized to configuration, and no actionable merge-blocking risk remains after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the removal of the obsolete PHPStan ignore entry for get_term_by().
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phpstan-unmatched-ignores

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@swissspidy swissspidy added this to the 3.0.3 milestone Aug 30, 2026
@swissspidy
swissspidy merged commit c3a8a49 into main Aug 30, 2026
64 checks passed
@swissspidy
swissspidy deleted the fix/phpstan-unmatched-ignores branch August 30, 2026 07:37
@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

bug scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants