Skip to content

Commit

Permalink
$matches[reason] may be an empty string here
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastix committed Feb 10, 2025
1 parent 5a7443b commit 3177bcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/HttpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function pull(): MessageInterface
// Pulling response
preg_match('!^HTTP/(?P<version>[0-9/.]+) (?P<code>[0-9]*)($|\s(?P<reason>.*))!', $status, $matches);
if (!empty($matches)) {
$message = new Response((int)$matches['code'], $matches['reason']);
$message = new Response((int)$matches['code'], $matches['reason'] ?? '');
$version = $matches['version'];
}

Expand Down

0 comments on commit 3177bcd

Please sign in to comment.