Skip to content

Fix PHPStan error in wp transient delete - #132

Merged
swissspidy merged 1 commit into
mainfrom
fix/phpstan-flag-value-default
Oct 8, 2026
Merged

swissspidy merged 1 commit into
mainfrom
fix/phpstan-flag-value-default

Conversation

@swissspidy

@swissspidy swissspidy commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The Code Quality workflow on main now fails with:

src/Transient_Command.php:201  Parameter #1 $network of method Transient_Command::delete_all() expects bool, bool|null given.
src/Transient_Command.php:204  Parameter #1 $network of method Transient_Command::delete_expired() expects bool, bool|null given.

Utils\get_flag_value() is typed as returning null when no default is given. This PR passes an explicit false default for all, expired and network in Transient_Command::delete(), matching how list_() already calls it. Runtime behavior stays the same because the checks use true ===, and delete_all()/delete_expired() already treated a missing flag as falsy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLJFdm3myamNTyyrDXQbvh


Generated by Claude Code

Summary by CodeRabbit

  • Maintenance
    • Updated how command options are handled internally. The command’s selection and deletion behavior remain unchanged, so there are no user-visible changes in this update.

Fixes PHPStan error where bool|null was passed to delete_all() and
delete_expired(), which expect bool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MLJFdm3myamNTyyrDXQbvh
@swissspidy
swissspidy requested a review from a team as a code owner October 8, 2026 06:04
Copilot AI balanced review requested due to automatic review settings October 8, 2026 06:04

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 command:transient-delete Related to 'transient delete' command labels Oct 8, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4cc4ff9-10da-473b-99f0-01d5ce13e878
📥 Commits

Reviewing files that changed from the base of the PR and between 2789122 and 289b018.

📒 Files selected for processing (1)
  • src/Transient_Command.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Transient_Command::delete() now passes false as the default when it reads the all, expired, and network flags. Option selection and deletion behavior remain unchanged.

Changes

Transient deletion

Layer / File(s) Summary
Deletion flag defaults
src/Transient_Command.php
delete() now passes false as the default when it reads the all, expired, and network flags.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: schlessera

Merge Risk: ⚪ Minimal · up to 289b0

The new defaults do not change the existing deletion behavior for missing or null flags. No actionable merge risk is identified; merge after the normal Composer checks pass.

🚥 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 primary change: fixing the PHPStan error in wp transient delete by providing explicit defaults for flag values.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 PHPStan (2.2.14)

Invalid configuration:
Unexpected item 'parameters › strictRules'.


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.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@swissspidy
swissspidy merged commit 7306edb into main Oct 8, 2026
57 checks passed
@swissspidy
swissspidy deleted the fix/phpstan-flag-value-default branch October 8, 2026 06:12
@swissspidy swissspidy added this to the 3.0.1 milestone Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:transient-delete Related to 'transient delete' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants