Skip to content

Commit d7b45f7

Browse files
committed
Use str_contains
1 parent aefc35d commit d7b45f7

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
@@ -197,10 +197,6 @@ private function parseResponse(ResponseInterface $response)
197197
*/
198198
private function isJSONResponse(array $headerValues): bool
199199
{
200-
$filteredHeaders = array_filter($headerValues, static function (string $headerValue) {
201-
return false !== strpos($headerValue, 'application/json');
202-
});
203-
204-
return \count($filteredHeaders) > 0;
200+
return [] !== array_filter($headerValues, static fn (string $v) => str_contains($v, 'application/json'));
205201
}
206202
}

0 commit comments

Comments
 (0)