From: Philipp <admin+Github@philipp.info>
Date: Sat, 10 Oct 2020 22:33:36 +0000 (+0200)
Subject: Update src/Network/GuzzleResponse.php
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=79e667b3d10c05e39dd081704ce54485f42ba095;p=friendica.git

Update src/Network/GuzzleResponse.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
---

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} */