mirror of
https://github.com/itflow-org/itflow
synced 2026-08-16 04:25:13 +00:00
Mail Parser: Completely remove Webklex IMAP and all dependcies
This commit is contained in:
19
plugins/vendor/guzzlehttp/psr7/src/Utils.php
vendored
19
plugins/vendor/guzzlehttp/psr7/src/Utils.php
vendored
@@ -462,6 +462,9 @@ final class Utils
|
||||
* in subsequent reads. String inputs are always treated as string bodies,
|
||||
* even when they name callable functions.
|
||||
*
|
||||
* Passing a non-string scalar (`int`, `float`, or `bool`) is deprecated; cast
|
||||
* it to a string instead. guzzlehttp/psr7 3.0 will reject non-string scalars.
|
||||
*
|
||||
* @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
|
||||
* @param array{size?: int, metadata?: array} $options Additional options
|
||||
*
|
||||
@@ -470,6 +473,22 @@ final class Utils
|
||||
public static function streamFor($resource = '', array $options = []): StreamInterface
|
||||
{
|
||||
if (is_scalar($resource)) {
|
||||
if (!is_string($resource)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.12',
|
||||
'Passing %s to Utils::streamFor() is deprecated; cast it to a string. guzzlehttp/psr7 3.0 will only accept string, resource, StreamInterface, Stringable, Iterator, callable, or null.',
|
||||
\gettype($resource)
|
||||
);
|
||||
|
||||
if (is_float($resource) && !is_finite($resource)) {
|
||||
// Normalized only to avoid PHP 8.5's (string) NAN warning
|
||||
// while deprecated; 3.0 rejects non-finite floats with every
|
||||
// other non-string scalar.
|
||||
$resource = is_nan($resource) ? 'NAN' : ($resource > 0 ? 'INF' : '-INF');
|
||||
}
|
||||
}
|
||||
|
||||
$stream = self::tryFopen('php://temp', 'r+');
|
||||
if ($resource !== '') {
|
||||
fwrite($stream, (string) $resource);
|
||||
|
||||
Reference in New Issue
Block a user