diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 277e015..4b215cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,4 +30,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.1', '8.2', '8.3', '8.4', '8.5'] + ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] diff --git a/.github/workflows/composer-dependency-analyser.yml b/.github/workflows/composer-dependency-analyser.yml index 06a8cbe..963a949 100644 --- a/.github/workflows/composer-dependency-analyser.yml +++ b/.github/workflows/composer-dependency-analyser.yml @@ -26,4 +26,4 @@ jobs: uses: yiisoft/actions/.github/workflows/composer-dependency-analyser.yml@master with: php: >- - ['8.1', '8.2', '8.3', '8.4', '8.5'] + ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] diff --git a/CHANGELOG.md b/CHANGELOG.md index e7129f1..b9250d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,16 @@ - Enh #104, #168: Render exception class PHPDoc description with safe markdown links in HTML debug output (@dbuhonov, @vjik) - Chg #162: Replace deprecated `ThrowableResponseFactory` class usage to new one, and remove it (@vjik) - Enh #163: Explicitly import classes, functions, and constants in "use" section (@mspirkov) -- Chg #170: Make all parameters of `ErrorException` constructor required (@vjik) -- New #171: Add `$traceFileMap` parameter to `HtmlRenderer` for mapping file paths in trace links (@WarLikeLaux) ## 4.3.3 November 25, 2026 - Bug #164: Fix missing items in stack trace HTML output when handling a PHP error (@vjik) - Bug #166: Fix broken link to error handling guide (@vjik) - Bug #176: Remove unused `ext-dom` dependency (@samdark) +- Chg #170: Make all parameters of `ErrorException` constructor required (@vjik) +- New #171: Add `$traceFileMap` parameter to `HtmlRenderer` for mapping file paths in trace links (@WarLikeLaux) +- Enh #192: Add PHP 8.6 support (@roxblnfk) +- Bug #192: Escape cURL command in HTML debug output (@roxblnfk) ## 4.3.2 January 09, 2026 diff --git a/README.md b/README.md index bd60938..991a683 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The package provides advanced error handling. The features are: ## Requirements -- PHP 8.1 - 8.5. +- PHP 8.1 - 8.6. - `mbstring` PHP extension. ## Installation diff --git a/composer.json b/composer.json index 2bebcaf..793ccfa 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ } ], "require": { - "php": "8.1 - 8.5", + "php": "8.1 - 8.6", "ext-mbstring": "*", "alexkart/curl-builder": "^1.0", "cebe/markdown": "^1.2", @@ -54,7 +54,7 @@ "rector/rector": "^2.1.3", "shipmonk/composer-dependency-analyser": "^1.8", "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1 || ^6.13.1", + "vimeo/psalm": "^6.21 || ^7.20", "yiisoft/di": "^1.4", "yiisoft/test-support": "^3.0.2" }, diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 00dc35a..31e8f5f 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -220,6 +220,7 @@ private function renderThrowableAndTerminate(Throwable $t): void // Set preventive HTTP status code to 500 in case error handling somehow fails and headers are sent. http_response_code(Status::INTERNAL_SERVER_ERROR); + /** @psalm-suppress TaintedInput Escaping the output is the renderer's responsibility. */ echo $this->handle($t); $this->eventDispatcher?->dispatch(new ApplicationError($t)); diff --git a/src/Renderer/HtmlRenderer.php b/src/Renderer/HtmlRenderer.php index e86b1c9..e1097df 100644 --- a/src/Renderer/HtmlRenderer.php +++ b/src/Renderer/HtmlRenderer.php @@ -16,10 +16,10 @@ use Yiisoft\ErrorHandler\ThrowableRendererInterface; use Yiisoft\FriendlyException\FriendlyExceptionInterface; use Yiisoft\Http\Header; -use ReflectionClass; use ReflectionException; use ReflectionFunction; use ReflectionMethod; +use ReflectionObject; use function array_values; use function dirname; @@ -583,7 +583,7 @@ public function removeAnonymous(string $value): string */ private function getThrowableDescription(Throwable $throwable): ?string { - $docComment = (new ReflectionClass($throwable))->getDocComment(); + $docComment = (new ReflectionObject($throwable))->getDocComment(); if ($docComment === false) { return null; } @@ -701,7 +701,7 @@ private function renderTemplate(string $path, array $parameters): string ob_implicit_flush(false); try { - /** @psalm-suppress PossiblyNullFunctionCall */ + /** @psalm-suppress PossiblyNullFunctionCall, TooManyArguments */ $renderer->bindTo($this)($path, $parameters); return (string) ob_get_clean(); } catch (Throwable $e) { diff --git a/templates/development.php b/templates/development.php index e446977..1ff319d 100644 --- a/templates/development.php +++ b/templates/development.php @@ -128,12 +128,12 @@ class="copy-clipboard" renderCurl($request)) !== 'curl'): ?>