From 15af8e34ef8237ad073b48fa76654fe33fc41577 Mon Sep 17 00:00:00 2001 From: yaozm Date: Fri, 14 Jun 2024 11:54:58 +0800 Subject: [PATCH] ci(src/Foundation/Message.php): Add toMultipart method - Added toMultipart method to handle multipart requests - Suppressed UndefinedConstant warning in the method --- composer-require-checker.json | 1 + src/Foundation/Message.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/composer-require-checker.json b/composer-require-checker.json index 67d664d..7a40ab4 100644 --- a/composer-require-checker.json +++ b/composer-require-checker.json @@ -33,6 +33,7 @@ "Composer\\InstalledVersions", "GuzzleHttp\\Psr7\\HttpFactory", "GuzzleHttp\\Psr7\\Message", + "GuzzleHttp\\Psr7\\MultipartStream", "GuzzleHttp\\Psr7\\Response", "GuzzleHttp\\Psr7\\Utils", "Illuminate\\Support\\Collection", diff --git a/src/Foundation/Message.php b/src/Foundation/Message.php index 28efb1d..860732a 100644 --- a/src/Foundation/Message.php +++ b/src/Foundation/Message.php @@ -90,6 +90,9 @@ protected function toQuery( return http_build_query($this->toPayload(), $numericPrefix, $argSeparator, $encodingType); } + /** + * @psalm-suppress UndefinedConstant + */ protected function toMultipart(int $options = MULTIPART_TRY_OPEN_FILE): MultipartStream { return new MultipartStream(Utils::multipartFor($this->toPayload(), $options));