Skip to content

Commit 1172c8c

Browse files
authored
refactor: revert property promotion on Exceptions (#9995)
1 parent 0643115 commit 1172c8c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

rector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@
125125
// use mt_rand instead of random_int on purpose on non-cryptographically random
126126
RandomFunctionRector::class,
127127

128-
// PHP 8.0 features but cause breaking changes
128+
// CPP of untyped properties may break code of extended classes
129129
ClassPropertyAssignToConstructorPromotionRector::class => [
130130
__DIR__ . '/system/Database/BaseResult.php',
131131
__DIR__ . '/system/Database/RawSql.php',
132132
__DIR__ . '/system/Debug/BaseExceptionHandler.php',
133+
__DIR__ . '/system/Debug/Exceptions.php',
133134
__DIR__ . '/system/Filters/Filters.php',
134135
__DIR__ . '/system/HTTP/CURLRequest.php',
135136
__DIR__ . '/system/HTTP/DownloadResponse.php',

system/Debug/Exceptions.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ class Exceptions
3333
{
3434
use ResponseTrait;
3535

36+
/**
37+
* Config for debug exceptions.
38+
*
39+
* @var ExceptionsConfig
40+
*/
41+
protected $config;
42+
3643
/**
3744
* The request.
3845
*
@@ -49,9 +56,9 @@ class Exceptions
4956

5057
private ?Throwable $exceptionCaughtByExceptionHandler = null;
5158

52-
public function __construct(
53-
protected ExceptionsConfig $config,
54-
) {
59+
public function __construct(ExceptionsConfig $config)
60+
{
61+
$this->config = $config;
5562
}
5663

5764
/**

0 commit comments

Comments
 (0)