Skip to content

Fix newly reported PHPStan error - #95

Merged
swissspidy merged 2 commits into
mainfrom
fix/phpstan
Aug 7, 2026
Merged

Fix newly reported PHPStan error#95
swissspidy merged 2 commits into
mainfrom
fix/phpstan

Conversation

@swissspidy

@swissspidy swissspidy commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved alias processing by ignoring invalid targets without a valid, non-empty path.
    • Prevented malformed alias configurations from being normalized.

@swissspidy swissspidy added this to the 3.0.1 milestone Aug 7, 2026
@swissspidy
swissspidy requested a review from a team as a code owner August 7, 2026 20:10
Copilot AI lite review requested due to automatic review settings August 7, 2026 20:10
@swissspidy swissspidy added the scope:testing Related to testing label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@swissspidy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e129d482-ac32-42d9-9ed0-1d0b7256bc7b

📥 Commits

Reviewing files that changed from the base of the PR and between f63c4a7 and 68881fc.

📒 Files selected for processing (2)
  • features/find.feature
  • src/Find_Command.php
📝 Walkthrough

Walkthrough

Alias processing now skips targets that are not arrays or do not contain a non-empty string path.

Changes

Alias validation

Layer / File(s) Summary
Validate alias targets
src/Find_Command.php
Alias processing validates target structure and skips invalid targets before normalization.

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

Suggested reviewers: brianhenryie

🚥 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 pull request's main change: fixing a newly reported PHPStan error.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phpstan

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Find_Command.php`:
- Line 216: Update the target path validation in Find_Command to replace
empty($target['path']) with an explicit comparison against an empty string after
confirming it is a string, so the valid path value '0' is retained while
genuinely empty paths are rejected.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b860ad9-4ab4-4f76-8d47-6ad384e1dd43

📥 Commits

Reviewing files that changed from the base of the PR and between 42ab57c and f63c4a7.

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

Comment thread src/Find_Command.php Outdated
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Pull request overview

This PR updates the wp find command’s alias resolution logic to avoid PHPStan/type issues by skipping malformed alias targets, ensuring only valid alias configurations are normalized and used when rendering the alias field.

Changes:

  • Guard alias processing by requiring each alias target to be an array with a non-empty string path.
  • Prevent normalization of malformed alias configurations that could trigger static analysis errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Find_Command.php
@swissspidy
swissspidy merged commit 8597047 into main Aug 7, 2026
51 checks passed
@swissspidy
swissspidy deleted the fix/phpstan branch August 7, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants