Skip to content

Add PHP 8.6 support - #192

Open
roxblnfk wants to merge 2 commits into
masterfrom
php-8.6
Open

roxblnfk wants to merge 2 commits into
masterfrom
php-8.6

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 25, 2026 •

Copy link
Copy Markdown
Member
Q A
Is bugfix? ✔️
New feature? ✔️
Breaks BC? ❌
Fixed issues —
  • Allows PHP 8.6 in composer.json and adds 8.6 to the build and dependency analyser matrices.
  • PHP 8.6 dropped the file name from the file() warning prefix (file(): Failed to open stream… instead of file(not-exist): …), so the HtmlRenderer test now expects a version-specific message; renderer behaviour is unchanged.
  • Psalm constraint raised to ^6.21 || ^7.20. Psalm 7 runs taint analysis and found that the cURL block of the HTML debug page printed the command (built from the request or an exception message) unescaped; it is now escaped like the throwable block next to it.
  • The remaining Psalm 7 reports are false positives: ReflectionClass is replaced by ReflectionObject (Psalm took the object for a class-name string), and two statement-level suppressions cover the template closure that reads its arguments via func_get_arg() and the echo of already rendered output in ErrorHandler.
  • Psalm does not support PHP 8.6 yet, so static.yml stays at 8.5; dev dependencies on 8.6 install only with --ignore-platform-req=php.

Summary by Sourcery

Support PHP 8.6 while preserving renderer compatibility and safely displaying cURL diagnostics.

New Features:

  • Add PHP 8.6 support across package requirements and compatibility checks.

Bug Fixes:

  • Escape rendered cURL diagnostics to prevent unsafe HTML output.

Enhancements:

  • Update renderer compatibility handling for PHP 8.6 and newer static-analysis requirements.

CI:

  • Include PHP 8.6 in the build and Composer dependency-analysis matrices.

Documentation:

  • Update the documented PHP requirements to include PHP 8.6.

Tests:

  • Adapt renderer error-message coverage for the PHP 8.6 warning format.

test: adapt HtmlRenderer test to PHP 8.6 error message

PHP 8.6 no longer includes the file name in the `file()` warning prefix. Psalm does not support PHP 8.6 yet, so the static analysis matrix stays at 8.5.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@psalm-shepherd

Copy link
Copy Markdown

Psalm found errors in other files

src/ErrorHandler.php:223:9 - Detected tainted HTML
src/ErrorHandler.php:223:9 - Detected tainted text with possible quotes
src/Renderer/HtmlRenderer.php:586:44 - Detected tainted text
src/Renderer/HtmlRenderer.php:705:13 - Too many arguments for callable() - expecting 0 but saw 2
templates/development.php:131:38 - Detected tainted HTML
templates/development.php:131:38 - Detected tainted text with possible quotes
templates/development.php:136:32 - Detected tainted HTML
templates/development.php:136:32 - Detected tainted text with possible quotes

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (11f22f4) to head (b4d5248).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #192   +/-   ##
=========================================
  Coverage     87.18%   87.18%           
  Complexity      225      225           
=========================================
  Files            19       19           
  Lines           710      710           
=========================================
  Hits            619      619           
  Misses           91       91           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (11f22f4) to head (c3b89e6).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #192   +/-   ##
=========================================
  Coverage     87.18%   87.18%           
  Complexity      225      225           
=========================================
  Files            19       19           
  Lines           710      710           
=========================================
  Hits            619      619           
  Misses           91       91           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

chore: fix Psalm 7 issues

Psalm 7 enables taint analysis, which found that the cURL block in `development.php` printed the command (built from the request or an exception message) without escaping. The other reports are false positives: `ReflectionClass` received an object, the template closure reads its arguments via `func_get_arg()` on purpose, and `ErrorHandler` echoes already rendered output.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@psalm-shepherd

Copy link
Copy Markdown

Psalm didn’t find any errors!

1 similar comment
@psalm-shepherd

Copy link
Copy Markdown

Psalm didn’t find any errors!

@roxblnfk
roxblnfk requested a review from a team November 25, 2026 17:08
roxblnfk added a commit to spiral-packages/yii-error-handler-bridge that referenced this pull request Nov 25, 2026
fix: escape cURL command in the development error page

The bridge ships its own copy of the development template, so the upstream XSS fix (yiisoft/error-handler#192) has to be ported by hand.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants