From a338e4cbff7c0e9b238bf53b4b369398a822b45d Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 20 Aug 2021 19:48:23 +0200 Subject: [PATCH] Update src/Network/GuzzleResponse.php --- src/Network/GuzzleResponse.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Network/GuzzleResponse.php b/src/Network/GuzzleResponse.php index 18155d1d29..b1bbaa9653 100644 --- a/src/Network/GuzzleResponse.php +++ b/src/Network/GuzzleResponse.php @@ -89,12 +89,7 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface public function getContentType() { $contentTypes = $this->getHeader('Content-Type') ?? []; - $countTypes = count($contentTypes); - if ($countTypes > 0) { - return $contentTypes[$countTypes - 1]; - } else { - return ''; - } + return array_pop($contentTypes) ?? ''; } /** {@inheritDoc} */