summaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/psr7/src/MultipartStream.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/guzzlehttp/psr7/src/MultipartStream.php')
-rw-r--r--vendor/guzzlehttp/psr7/src/MultipartStream.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php
index 3e12b74..41c48ee 100644
--- a/vendor/guzzlehttp/psr7/src/MultipartStream.php
+++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php
@@ -60,7 +60,7 @@ final class MultipartStream implements StreamInterface
$str .= "{$key}: {$value}\r\n";
}
- return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n";
+ return "--{$this->boundary}\r\n".trim($str)."\r\n\r\n";
}
/**
@@ -72,7 +72,7 @@ final class MultipartStream implements StreamInterface
foreach ($elements as $element) {
if (!is_array($element)) {
- throw new \UnexpectedValueException("An array is expected");
+ throw new \UnexpectedValueException('An array is expected');
}
$this->addElement($stream, $element);
}
@@ -137,9 +137,7 @@ final class MultipartStream implements StreamInterface
// Set a default Content-Type if one was not supplied
$type = $this->getHeader($headers, 'content-type');
if (!$type && ($filename === '0' || $filename)) {
- if ($type = MimeType::fromFilename($filename)) {
- $headers['Content-Type'] = $type;
- }
+ $headers['Content-Type'] = MimeType::fromFilename($filename) ?? 'application/octet-stream';
}
return [$stream, $headers];