Skip to content

Fix newly reported PHPStan errors - #104

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

Fix newly reported PHPStan errors#104
swissspidy merged 2 commits into
mainfrom
fix/phpstan

Conversation

@swissspidy

@swissspidy swissspidy commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of server document root configuration when the value is missing or not provided as text.
    • Server configuration options are now applied only when a valid, non-empty configuration is provided.
    • Removed an obsolete static-analysis exception related to server configuration checks.
  • Tests

    • Added coverage confirming custom PHP configuration values are applied when serving files.

@swissspidy swissspidy added this to the 3.0.1 milestone Aug 6, 2026
@swissspidy
swissspidy requested a review from a team as a code owner August 6, 2026 09:10
Copilot AI lite review requested due to automatic review settings August 6, 2026 09:10
@swissspidy swissspidy added the scope:testing Related to testing label Aug 6, 2026
@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: 01cdd88b-9217-466c-9adf-cb1d0b082e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 09f41b7 and 3709828.

📒 Files selected for processing (2)
  • features/server.feature
  • src/Server_Command.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Server_Command.php

📝 Walkthrough

Walkthrough

The PHP server command now casts the document root to a string and passes the configuration option only when it contains a non-empty string. An integration scenario verifies a custom memory_limit value.

Changes

Server command

Layer / File(s) Summary
Handle server configuration arguments
src/Server_Command.php, features/server.feature
The command conditionally adds the configuration option and removes an obsolete PHPStan suppression. The integration scenario verifies that --config=custom.ini applies a 512M memory limit.

Estimated code review effort: 2 (Simple) | ~10 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 primary change: fixing newly reported PHPStan errors.
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
📝 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.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Server_Command.php 0.00% 7 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

This PR updates the wp server command implementation to resolve newly reported PHPStan type errors in the server command construction path.

Changes:

  • Casts $docroot to string when building the php -S command arguments.
  • Normalizes the --config value to a string to satisfy static analysis.
  • Removes an inline @phpstan-ignore around the adapt-scheme flag lookup.

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

Comment thread src/Server_Command.php Outdated
@swissspidy
swissspidy merged commit 0a858c8 into main Aug 6, 2026
63 checks passed
@swissspidy
swissspidy deleted the fix/phpstan branch August 6, 2026 10:53
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