Fix deprecation for PHP 8.4

This commit is contained in:
sebastian 2025-01-17 20:34:25 +01:00
parent 7a99446574
commit ac27906e6b

View File

@ -38,10 +38,7 @@ class AdditionalConfiguration
'displayErrors' => 1, 'displayErrors' => 1,
'systemLogLevel' => 0, 'systemLogLevel' => 0,
'exceptionalErrors' => 12290, 'exceptionalErrors' => 12290,
'errorHandlerErrors' => E_ALL & ~( 'errorHandlerErrors' => 0,
E_STRICT | E_NOTICE | E_WARNING | E_COMPILE_WARNING | E_COMPILE_ERROR
| E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR
),
], ],
]; ];
@ -55,6 +52,21 @@ class AdditionalConfiguration
'transport_smtp_server' => 'mailpit:1025' 'transport_smtp_server' => 'mailpit:1025'
]; ];
public function __construct()
{
if (PHP_VERSION_ID >= 80400) {
$this->developConfig['SYS']['errorHandlerErrors'] = E_ALL & ~(
\E_NOTICE | \E_WARNING | \E_COMPILE_WARNING | \E_COMPILE_ERROR
| \E_CORE_WARNING | \E_CORE_ERROR | \E_PARSE | \E_ERROR
);
} else {
$this->developConfig['SYS']['errorHandlerErrors'] = \E_ALL & ~(
\E_STRICT | \E_NOTICE | \E_WARNING | \E_COMPILE_WARNING | \E_COMPILE_ERROR
| \E_CORE_WARNING | \E_CORE_ERROR | \E_PARSE | \E_ERROR
);
}
}
public function initialize(array $configuration = []): void public function initialize(array $configuration = []): void
{ {
$this->addContextToSitename(); $this->addContextToSitename();