Skip to content

Commit

Permalink
ci(src/Foundation/Message.php): Add toMultipart method
Browse files Browse the repository at this point in the history
- Added toMultipart method to handle multipart requests
- Suppressed UndefinedConstant warning in the method
  • Loading branch information
guanguans committed Jun 14, 2024
1 parent e7c2a7c commit 15af8e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"Composer\\InstalledVersions",
"GuzzleHttp\\Psr7\\HttpFactory",
"GuzzleHttp\\Psr7\\Message",
"GuzzleHttp\\Psr7\\MultipartStream",
"GuzzleHttp\\Psr7\\Response",
"GuzzleHttp\\Psr7\\Utils",
"Illuminate\\Support\\Collection",
Expand Down
3 changes: 3 additions & 0 deletions src/Foundation/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 15af8e3

Please sign in to comment.