Skip to content

Commit 0c986ea

Browse files
committed
Use str_contains
1 parent 9cf7a37 commit 0c986ea

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Http/Client.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ private function parseResponse(ResponseInterface $response)
195195
*/
196196
private function isJSONResponse(array $headerValues): bool
197197
{
198-
$filteredHeaders = array_filter($headerValues, static function (string $headerValue) {
199-
return false !== strpos($headerValue, 'application/json');
200-
});
201-
202-
return \count($filteredHeaders) > 0;
198+
return [] !== array_filter($headerValues, static fn (string $v) => str_contains($v, 'application/json'));
203199
}
204200
}

0 commit comments

Comments
 (0)