From 79e667b3d10c05e39dd081704ce54485f42ba095 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 11 Oct 2020 00:33:36 +0200 Subject: [PATCH] Update src/Network/GuzzleResponse.php Co-authored-by: Hypolite Petovan --- 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 18155d1d2..b1bbaa965 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} */