Update imapengine dependancies too

This commit is contained in:
johnnyq
2026-08-02 01:26:40 -04:00
parent cf4446f405
commit 3e532fc792
185 changed files with 9018 additions and 4442 deletions

View File

@@ -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;
}
}