Skip to content

Commit 676666e

Browse files
TomA-Rcopybara-github
authored andcommitted
Fix PHP 8.4 deprecation in GPBDecodeException (#21232)
PHP 8.4 deprecates implicitly nullable parameter declarations. This patch addresses an issue in `Google\Protobuf\Internal\GPBDecodeException` which triggers a deprecation warning. The deprecation warning that's fixed is: ``` vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php:14 Google\Protobuf\Internal\GPBDecodeException::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead ``` See also: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated There are no automated tests to be added here since it simply fixes the deprecation warning. Closes #21232 COPYBARA_INTEGRATE_REVIEW=#21232 from TomA-R:php84_nullable_gpbdecodeexception 7cdcb75 PiperOrigin-RevId: 749265866
1 parent b21bcf9 commit 676666e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/src/Google/Protobuf/Internal/GPBDecodeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GPBDecodeException extends \Exception
1414
public function __construct(
1515
$message,
1616
$code = 0,
17-
\Exception $previous = null)
17+
?\Exception $previous = null)
1818
{
1919
parent::__construct(
2020
"Error occurred during parsing: " . $message,

0 commit comments

Comments
 (0)