From 2d27b46802d2320e4edb09abfee2008c97e75d38 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 11 Nov 2021 16:00:34 +0000 Subject: [PATCH] Update deprecated Guzzle Psr7 function calls Change-Id: If7cc461559d4857a7bae8b71cc8283fbabfe9a28 --- includes/http/MWCallbackStream.php | 3 ++- includes/http/MwHttpRequestToResponseInterfaceAdapter.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/http/MWCallbackStream.php b/includes/http/MWCallbackStream.php index f325c366b4d..2472f164ff6 100644 --- a/includes/http/MWCallbackStream.php +++ b/includes/http/MWCallbackStream.php @@ -19,6 +19,7 @@ */ use GuzzleHttp\Psr7\StreamDecoratorTrait; +use GuzzleHttp\Psr7\Utils; use Psr\Http\Message\StreamInterface; /** @@ -38,7 +39,7 @@ class MWCallbackStream implements StreamInterface { private $callback; public function __construct( callable $cb ) { - $this->stream = GuzzleHttp\Psr7\stream_for(); + $this->stream = Utils::streamFor(); $this->callback = $cb; } diff --git a/includes/http/MwHttpRequestToResponseInterfaceAdapter.php b/includes/http/MwHttpRequestToResponseInterfaceAdapter.php index 3a547b30bd4..a4d5f279806 100644 --- a/includes/http/MwHttpRequestToResponseInterfaceAdapter.php +++ b/includes/http/MwHttpRequestToResponseInterfaceAdapter.php @@ -3,11 +3,11 @@ declare( strict_types = 1 ); namespace MediaWiki\Http; +use GuzzleHttp\Psr7\Utils; use LogicException; use MWHttpRequest; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; -use function GuzzleHttp\Psr7\stream_for; /** * @since 1.36 @@ -73,7 +73,7 @@ class MwHttpRequestToResponseInterfaceAdapter implements ResponseInterface { } public function getBody(): StreamInterface { - return stream_for( $this->mwHttpRequest->getContent() ); + return Utils::streamFor( $this->mwHttpRequest->getContent() ); } public function withBody( StreamInterface $body ): void {