mirror of
https://github.com/itflow-org/itflow
synced 2026-09-21 06:01:15 +00:00
Update imapengine dependancies too
This commit is contained in:
71
libs/vendor/guzzlehttp/psr7/src/BufferStream.php
vendored
71
libs/vendor/guzzlehttp/psr7/src/BufferStream.php
vendored
@@ -16,22 +16,22 @@ use Psr\Http\Message\StreamInterface;
|
||||
*/
|
||||
final class BufferStream implements StreamInterface
|
||||
{
|
||||
/** @var int */
|
||||
private $hwm;
|
||||
use NonSerializableStreamTrait;
|
||||
|
||||
/** @var string */
|
||||
private $buffer = '';
|
||||
private int $hwm;
|
||||
|
||||
private string $buffer = '';
|
||||
|
||||
/**
|
||||
* @param int $hwm High water mark, representing the preferred maximum
|
||||
* buffer size. If the size of the buffer exceeds the high
|
||||
* water mark, then calls to write will continue to succeed
|
||||
* but will return 0 to inform writers to slow down
|
||||
* buffer size. If the size of the buffer reaches or exceeds
|
||||
* the high water mark, then calls to write will continue to
|
||||
* succeed but will return 0 to inform writers to slow down
|
||||
* until the buffer has been drained by reading from it.
|
||||
*/
|
||||
public function __construct(int $hwm = 16384)
|
||||
{
|
||||
$this->hwm = $hwm;
|
||||
$this->hwm = Integers::assertNonNegativeInteger($hwm, 'High water mark');
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
@@ -84,26 +84,8 @@ final class BufferStream implements StreamInterface
|
||||
$this->seek(0);
|
||||
}
|
||||
|
||||
public function seek($offset, $whence = SEEK_SET): void
|
||||
public function seek(int $offset, int $whence = SEEK_SET): void
|
||||
{
|
||||
if (!\is_int($offset)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.11',
|
||||
'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $offset.',
|
||||
\get_debug_type($offset)
|
||||
);
|
||||
}
|
||||
|
||||
if (!\is_int($whence)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.11',
|
||||
'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $whence.',
|
||||
\get_debug_type($whence)
|
||||
);
|
||||
}
|
||||
|
||||
throw new \RuntimeException('Cannot seek a BufferStream');
|
||||
}
|
||||
|
||||
@@ -120,15 +102,10 @@ final class BufferStream implements StreamInterface
|
||||
/**
|
||||
* Reads data from the buffer.
|
||||
*/
|
||||
public function read($length): string
|
||||
public function read(int $length): string
|
||||
{
|
||||
if (!\is_int($length)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.11',
|
||||
'Passing %s to StreamInterface::read() is deprecated; guzzlehttp/psr7 3.0 requires int for $length.',
|
||||
\get_debug_type($length)
|
||||
);
|
||||
if ($length < 0) {
|
||||
throw new \RuntimeException('Length parameter cannot be negative');
|
||||
}
|
||||
|
||||
$currentLength = strlen($this->buffer);
|
||||
@@ -149,17 +126,8 @@ final class BufferStream implements StreamInterface
|
||||
/**
|
||||
* Writes data to the buffer.
|
||||
*/
|
||||
public function write($string): int
|
||||
public function write(string $string): int
|
||||
{
|
||||
if (!\is_string($string)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.11',
|
||||
'Passing %s to StreamInterface::write() is deprecated; guzzlehttp/psr7 3.0 requires string for $string.',
|
||||
\get_debug_type($string)
|
||||
);
|
||||
}
|
||||
|
||||
$this->buffer .= $string;
|
||||
|
||||
if (strlen($this->buffer) >= $this->hwm) {
|
||||
@@ -172,21 +140,12 @@ final class BufferStream implements StreamInterface
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
public function getMetadata(?string $key = null)
|
||||
{
|
||||
if ($key !== null && !\is_string($key)) {
|
||||
\trigger_deprecation(
|
||||
'guzzlehttp/psr7',
|
||||
'2.11',
|
||||
'Passing %s to StreamInterface::getMetadata() is deprecated; guzzlehttp/psr7 3.0 requires string|null for $key.',
|
||||
\get_debug_type($key)
|
||||
);
|
||||
}
|
||||
|
||||
if ($key === 'hwm') {
|
||||
return $this->hwm;
|
||||
}
|
||||
|
||||
return $key ? null : [];
|
||||
return $key === null ? [] : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user