Skip to content

Fix newly reported PHPStan errors - #349

Merged
swissspidy merged 1 commit into
mainfrom
fix/phpstan
Aug 6, 2026
Merged

Fix newly reported PHPStan errors#349
swissspidy merged 1 commit into
mainfrom
fix/phpstan

Conversation

@swissspidy

@swissspidy swissspidy commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when passing the BEHAT_STEP_LINE value to launched processes.
    • Updated configuration handling so debug and prompt settings correctly support boolean and string values.

@swissspidy swissspidy added this to the 5.2.3 milestone Aug 6, 2026
@swissspidy
swissspidy requested a review from a team as a code owner August 6, 2026 09:06
Copilot AI lite review requested due to automatic review settings August 6, 2026 09:06
@swissspidy swissspidy added the scope:testing Related to testing label Aug 6, 2026
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/FeatureContext.php 0.00% 1 Missing ⚠️

📢 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

Adjusts WP-CLI tests and Behat process setup to align with updated PHPStan expectations, resolving newly reported PHPStan type errors in this repository.

Changes:

  • Update PHPStan assertion expectations for WP_CLI::get_config() to allow bool|string for debug and prompt.
  • Ensure BEHAT_STEP_LINE is always passed as a string environment variable when creating test processes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/data/get_config.php Updates PHPStan assertType() expectations for WP_CLI::get_config() return types.
src/Context/FeatureContext.php Casts $this->step_line to string when setting the BEHAT_STEP_LINE environment variable.

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

@coderabbitai

coderabbitai Bot commented Aug 6, 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: b35d4719-9813-4676-be0b-9f3922d0eb5b

📥 Commits

Reviewing files that changed from the base of the PR and between b02c72d and 0347b69.

📒 Files selected for processing (2)
  • src/Context/FeatureContext.php
  • tests/data/get_config.php

📝 Walkthrough

Walkthrough

The changes cast BEHAT_STEP_LINE to a string before process launch and update WP_CLI::get_config() assertions to accept boolean or string values for debug and prompt.

Changes

Environment normalization

Layer / File(s) Summary
Step-line environment casting
src/Context/FeatureContext.php
BEHAT_STEP_LINE is cast to a string before it is passed to launched processes.

Configuration assertions

Layer / File(s) Summary
Configuration type expectations
tests/data/get_config.php
Assertions for debug and prompt now accept `bool

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

Suggested reviewers: copilot, schlessera

🚥 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 describes the changes, which fix newly reported PHPStan errors in the testing scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.7)

PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives.


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 merged commit 9c4782b into main Aug 6, 2026
83 of 85 checks passed
@swissspidy
swissspidy deleted the fix/phpstan branch August 6, 2026 09:31
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