From b35fb51eb19c20dda5f0a97afa70c8254df786c0 Mon Sep 17 00:00:00 2001 From: Andrii Dembitskyi Date: Wed, 6 Jul 2022 22:25:45 +0300 Subject: [PATCH] Fix `symfony/error-handler` deprecations about required to be explicitly specified return types ``` PHP Deprecated: Method "Psr\Http\Message\ServerRequestInterface::getParsedBody()" might add "array|object|null" as a native return type declaration in the future. Do the same in implementation "Laminas\Diactoros\ServerRequest" now to avoid errors or add an explicit @return annotation to suppress this message. in .../vendor/symfony/error-handler/DebugClassLoader.php on line 330 PHP Deprecated: Method "Psr\Http\Message\ServerRequestInterface::getAttribute()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Laminas\Diactoros\ServerRequest" now to avoid errors or add an explicit @return annotation to suppress this message. in .../vendor/symfony/error-handler/DebugClassLoader.php on line 330 PHP Deprecated: Method "Psr\Http\Message\StreamInterface::getMetadata()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Laminas\Diactoros\Stream" now to avoid errors or add an explicit @return annotation to suppress this message. in .../vendor/symfony/error-handler/DebugClassLoader.php on line 330 ``` --- src/CallbackStream.php | 1 + src/RelativeStream.php | 1 + src/ServerRequest.php | 2 ++ src/Stream.php | 1 + 4 files changed, 5 insertions(+) diff --git a/src/CallbackStream.php b/src/CallbackStream.php index f908fd00..1dcb7ae9 100644 --- a/src/CallbackStream.php +++ b/src/CallbackStream.php @@ -159,6 +159,7 @@ public function getContents() : string /** * {@inheritdoc} + * @return mixed */ public function getMetadata($key = null) { diff --git a/src/RelativeStream.php b/src/RelativeStream.php index 993a266d..173f62b8 100644 --- a/src/RelativeStream.php +++ b/src/RelativeStream.php @@ -169,6 +169,7 @@ public function getContents() : string /** * {@inheritdoc} + * @return mixed */ public function getMetadata($key = null) { diff --git a/src/ServerRequest.php b/src/ServerRequest.php index 313fc055..f5afdbbb 100644 --- a/src/ServerRequest.php +++ b/src/ServerRequest.php @@ -165,6 +165,7 @@ public function withQueryParams(array $query) : ServerRequest /** * {@inheritdoc} + * @return array|object|null */ public function getParsedBody() { @@ -199,6 +200,7 @@ public function getAttributes() : array /** * {@inheritdoc} + * @return mixed */ public function getAttribute($attribute, $default = null) { diff --git a/src/Stream.php b/src/Stream.php index 063e96c7..74bb7eaf 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -301,6 +301,7 @@ public function getContents() : string /** * {@inheritdoc} + * @return mixed */ public function getMetadata($key = null) {