Update src/Network/GuzzleResponse.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Philipp 2020-10-11 00:33:36 +02:00 committed by GitHub
parent e17befb7d6
commit 79e667b3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

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