From 3eff7189ddaa2fdf2c025da7a164604014463abc Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Tue, 4 Apr 2023 14:56:05 +0100 Subject: [PATCH] Settings: `JsonFormat::decode()` expects string not StreamInterface JsonFormat::decode() expects the content to decode as a string not a StreamInterface but Response::getBody() will return a StreamInterface. This was caught by phan as a PhanTypeMismatchArgument error. This patch fixes it by calling getContents() which returns the remaining content as a string. Change-Id: I2ca03f06e7b481ccf19e1c39fa0002b4405ef23a --- includes/Settings/Source/EtcdSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Settings/Source/EtcdSource.php b/includes/Settings/Source/EtcdSource.php index 9fc16edfe8b..5e4565f8e9e 100644 --- a/includes/Settings/Source/EtcdSource.php +++ b/includes/Settings/Source/EtcdSource.php @@ -240,7 +240,7 @@ class EtcdSource implements CacheableSource { $settings = []; try { - $resp = $this->format->decode( $response->getBody() ); + $resp = $this->format->decode( $response->getBody()->getContents() ); if ( !isset( $resp['node'] ) || !is_array( $resp['node'] )