Skip to content

Commit d2ca052

Browse files
vjiksamdark
andauthored
Remove deprecated ThrowableResponseFactory (#162)
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
1 parent 499f3f0 commit d2ca052

5 files changed

Lines changed: 32 additions & 452 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Yii Error Handler Change Log
22

3-
## 4.3.3 under development
3+
## 5.0.0 under development
44

5-
- no changes in this release.
5+
- Chg #162: Replace deprecated `ThrowableResponseFactory` class usage to new one, and remove it (@vjik)
66

77
## 4.3.2 January 09, 2026
88

UPGRADE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Upgrading Instructions for Yii Error Handler
2+
3+
This file contains the upgrade notes. These notes highlight changes that could break your
4+
application when you upgrade the package from one version to another.
5+
6+
> **Important!** The following upgrading instructions are cumulative. That is, if you want
7+
> to upgrade from version A to version C and there is version B between A and C, you need
8+
> to follow the instructions for both A and B.
9+
10+
## Upgrade from 4.x
11+
12+
- `Yiisoft\ErrorHandler\Factory\ThrowableResponseFactory` was removed, use
13+
`Yiisoft\ErrorHandler\ThrowableResponseFactory` instead.

config/di-web.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
declare(strict_types=1);
44

5-
use Yiisoft\ErrorHandler\Factory\ThrowableResponseFactory;
5+
use Psr\Container\ContainerInterface;
6+
use Yiisoft\Definitions\DynamicReference;
67
use Yiisoft\ErrorHandler\Renderer\HtmlRenderer;
8+
use Yiisoft\ErrorHandler\RendererProvider\CompositeRendererProvider;
9+
use Yiisoft\ErrorHandler\RendererProvider\ContentTypeRendererProvider;
10+
use Yiisoft\ErrorHandler\RendererProvider\HeadRendererProvider;
711
use Yiisoft\ErrorHandler\ThrowableRendererInterface;
12+
use Yiisoft\ErrorHandler\ThrowableResponseFactory;
813
use Yiisoft\ErrorHandler\ThrowableResponseFactoryInterface;
914

1015
/**
@@ -13,5 +18,15 @@
1318

1419
return [
1520
ThrowableRendererInterface::class => HtmlRenderer::class,
16-
ThrowableResponseFactoryInterface::class => ThrowableResponseFactory::class,
21+
ThrowableResponseFactoryInterface::class => [
22+
'class' => ThrowableResponseFactory::class,
23+
'__construct()' => [
24+
'rendererProvider' => DynamicReference::to(
25+
static fn(ContainerInterface $container) => new CompositeRendererProvider(
26+
new HeadRendererProvider(),
27+
new ContentTypeRendererProvider($container),
28+
)
29+
),
30+
],
31+
],
1732
];

src/Factory/ThrowableResponseFactory.php

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)