From 6ffd6d36f9d537ab55c1e62785e93806bbc037a7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 19 Nov 2025 17:59:32 +0100 Subject: [PATCH 1/2] Fix PHP 7.2 compatibility for PHP 8.4 polyfill --- src/Php84/Resources/stubs/Deprecated.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Php84/Resources/stubs/Deprecated.php b/src/Php84/Resources/stubs/Deprecated.php index f3e6a4f8e..47d7e73bb 100644 --- a/src/Php84/Resources/stubs/Deprecated.php +++ b/src/Php84/Resources/stubs/Deprecated.php @@ -13,8 +13,17 @@ #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)] final class Deprecated { - public readonly ?string $message; - public readonly ?string $since; + /** + * @readonly + * @var ?string + */ + public $message; + + /** + * @readonly + * @var ?string + */ + public $since; public function __construct(?string $message = null, ?string $since = null) { From e09444f946fe4a9c761b0ab96a6bf328d056a13d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 19 Nov 2025 18:10:15 +0100 Subject: [PATCH 2/2] Updates --- src/Php84/Resources/stubs/Deprecated.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Php84/Resources/stubs/Deprecated.php b/src/Php84/Resources/stubs/Deprecated.php index 47d7e73bb..55f7da666 100644 --- a/src/Php84/Resources/stubs/Deprecated.php +++ b/src/Php84/Resources/stubs/Deprecated.php @@ -9,21 +9,32 @@ * file that was distributed with this source code. */ -if (\PHP_VERSION_ID < 80400) { +if (\PHP_VERSION_ID < 80100) { #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)] final class Deprecated { /** * @readonly - * @var ?string */ - public $message; + public ?string $message; /** * @readonly - * @var ?string */ - public $since; + public ?string $since; + + public function __construct(?string $message = null, ?string $since = null) + { + $this->message = $message; + $this->since = $since; + } + } +} elseif (\PHP_VERSION_ID < 80400) { + #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)] + final class Deprecated + { + public readonly ?string $message; + public readonly ?string $since; public function __construct(?string $message = null, ?string $since = null) {