diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
commit | 8bec661288b276c98bdb0e773e5f4d5275dc4c87 (patch) | |
tree | 8617ebe581c62fc46a7881aa61801ebce9d3c603 /vendor/guzzlehttp/psr7/src/Utils.php | |
parent | 540438c2eb5452bacad30c247906bfa287f2da1d (diff) |
Diffstat (limited to 'vendor/guzzlehttp/psr7/src/Utils.php')
-rw-r--r-- | vendor/guzzlehttp/psr7/src/Utils.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php index 3a4cf39..917c05e 100644 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -90,6 +90,7 @@ final class Utils } $buffer .= $buf; } + return $buffer; } @@ -174,7 +175,7 @@ final class Utils $standardPorts = ['http' => 80, 'https' => 443]; $scheme = $changes['uri']->getScheme(); if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; + $changes['set_headers']['Host'] .= ':'.$port; } } } @@ -230,7 +231,7 @@ final class Utils * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length */ - public static function readLine(StreamInterface $stream, ?int $maxLength = null): string + public static function readLine(StreamInterface $stream, int $maxLength = null): string { $buffer = ''; $size = 0; @@ -291,6 +292,7 @@ final class Utils fwrite($stream, (string) $resource); fseek($stream, 0); } + return new Stream($stream, $options); } @@ -308,6 +310,7 @@ final class Utils fseek($stream, 0); $resource = $stream; } + return new Stream($resource, $options); case 'object': /** @var object $resource */ @@ -320,6 +323,7 @@ final class Utils } $result = $resource->current(); $resource->next(); + return $result; }, $options); } elseif (method_exists($resource, '__toString')) { @@ -334,7 +338,7 @@ final class Utils return new PumpStream($resource, $options); } - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); } /** |