-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Hey, we are using PHP 8.4 and the current version v7.x
receive deprecations in the src/Exception/*
folder in the Exception-Classes.
For example in class:
src/Exception/InvalidRequiredArgumentException.php
src/Exception/InvalidOptionalArgumentException.php
The used __construct
functions are using old style of defining nullable parameters. As of PHP 8.4 this will throw a Deprecation: implicitly nullable parameters require it explicitily in the type def.
Current code with deprecation
public function __construct($message, $code = 0, Exception $previous = null)
// ^^^^^^^^^ Implicitly marking parameter as nullable is deprecated
{
parent::__construct($message, $code, $previous);
}
Fixed code with PHP ^8.2 style
public function __construct($message, $code = 0, ?Exception $previous = null)
// ^
{
parent::__construct($message, $code, $previous);
}
Could you please fix all occurrences to avoid deprecations in PHP 8.4 projects? Thanks.
Metadata
Metadata
Assignees
Labels
No labels