Update src/Network/GuzzleResponse.php
authorPhilipp <admin+Github@philipp.info>
Sat, 10 Oct 2020 22:33:36 +0000 (00:33 +0200)
committerGitHub <noreply@github.com>
Sat, 10 Oct 2020 22:33:36 +0000 (00:33 +0200)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Network/GuzzleResponse.php

index 18155d1..b1bbaa9 100644 (file)
@@ -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} */