summaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/psr7/src
diff options
context:
space:
mode:
authorwn_ <invalid@email.com>2025-08-24 14:40:07 +0000
committerwn_ <invalid@email.com>2025-08-24 14:40:07 +0000
commit618cb5bf7830d90e670e8cd1fd114b06173ab374 (patch)
treef74a50e6f5e2579af2c962892e91534725054c9d /vendor/guzzlehttp/psr7/src
parentf7fc00326e2f51f269f26b24a54d34e07a36846e (diff)
Bump Guzzle to 7.10.0 for PHP 8.5 compatibility.
https://github.com/guzzle/guzzle/compare/7.9.2...7.10.0
Diffstat (limited to 'vendor/guzzlehttp/psr7/src')
-rw-r--r--vendor/guzzlehttp/psr7/src/MessageTrait.php4
-rw-r--r--vendor/guzzlehttp/psr7/src/UploadedFile.php22
-rw-r--r--vendor/guzzlehttp/psr7/src/Uri.php2
-rw-r--r--vendor/guzzlehttp/psr7/src/Utils.php4
4 files changed, 14 insertions, 18 deletions
diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php
index 65dbc4ba0..c15ee63fc 100644
--- a/vendor/guzzlehttp/psr7/src/MessageTrait.php
+++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php
@@ -174,10 +174,6 @@ trait MessageTrait
return $this->trimAndValidateHeaderValues([$value]);
}
- if (count($value) === 0) {
- throw new \InvalidArgumentException('Header value can not be an empty array.');
- }
-
return $this->trimAndValidateHeaderValues($value);
}
diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php
index 9c9ea49fb..d9b779f13 100644
--- a/vendor/guzzlehttp/psr7/src/UploadedFile.php
+++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php
@@ -11,15 +11,15 @@ use RuntimeException;
class UploadedFile implements UploadedFileInterface
{
- private const ERRORS = [
- UPLOAD_ERR_OK,
- UPLOAD_ERR_INI_SIZE,
- UPLOAD_ERR_FORM_SIZE,
- UPLOAD_ERR_PARTIAL,
- UPLOAD_ERR_NO_FILE,
- UPLOAD_ERR_NO_TMP_DIR,
- UPLOAD_ERR_CANT_WRITE,
- UPLOAD_ERR_EXTENSION,
+ private const ERROR_MAP = [
+ UPLOAD_ERR_OK => 'UPLOAD_ERR_OK',
+ UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE',
+ UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE',
+ UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL',
+ UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE',
+ UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR',
+ UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE',
+ UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION',
];
/**
@@ -104,7 +104,7 @@ class UploadedFile implements UploadedFileInterface
*/
private function setError(int $error): void
{
- if (false === in_array($error, UploadedFile::ERRORS, true)) {
+ if (!isset(UploadedFile::ERROR_MAP[$error])) {
throw new InvalidArgumentException(
'Invalid error status for UploadedFile'
);
@@ -137,7 +137,7 @@ class UploadedFile implements UploadedFileInterface
private function validateActive(): void
{
if (false === $this->isOk()) {
- throw new RuntimeException('Cannot retrieve stream due to upload error');
+ throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error]));
}
if ($this->isMoved()) {
diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php
index 481dfca94..a7cdfb003 100644
--- a/vendor/guzzlehttp/psr7/src/Uri.php
+++ b/vendor/guzzlehttp/psr7/src/Uri.php
@@ -107,7 +107,7 @@ class Uri implements UriInterface, \JsonSerializable
{
// If IPv6
$prefix = '';
- if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
+ if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) {
/** @var array{0:string, 1:string, 2:string} $matches */
$prefix = $matches[1];
$url = $matches[2];
diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php
index 7682d2cdc..5451e3dcd 100644
--- a/vendor/guzzlehttp/psr7/src/Utils.php
+++ b/vendor/guzzlehttp/psr7/src/Utils.php
@@ -397,7 +397,7 @@ final class Utils
restore_error_handler();
if ($ex) {
- /** @var $ex \RuntimeException */
+ /** @var \RuntimeException $ex */
throw $ex;
}
@@ -444,7 +444,7 @@ final class Utils
restore_error_handler();
if ($ex) {
- /** @var $ex \RuntimeException */
+ /** @var \RuntimeException $ex */
throw $ex;
}