PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.6 28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 All 130 releases
← All changes | vendor_prefixed/guzzlehttp/psr7/src/DroppingStream.php +10 -5 18.4 → trunk View file →
@@ -1,6 +1,7 @@
1 1 <?php
2 2
3 +declare (strict_types=1);
3 4 namespace YoastSEO_Vendor\GuzzleHttp\Psr7;
4 5
5 6 use YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
6 7 /**
@@ -5,26 +6,30 @@
5 6 use YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
6 7 /**
7 8 * Stream decorator that begins dropping data once the size of the underlying
8 9 * stream becomes too full.
9 - *
10 - * @final
11 10 */
12 -class DroppingStream implements \YoastSEO_Vendor\Psr\Http\Message\StreamInterface
11 +final class DroppingStream implements \YoastSEO_Vendor\Psr\Http\Message\StreamInterface
13 12 {
14 13 use StreamDecoratorTrait;
14 + /** @var int */
15 15 private $maxLength;
16 + /** @var StreamInterface */
17 + private $stream;
16 18 /**
17 19 * @param StreamInterface $stream Underlying stream to decorate.
18 20 * @param int $maxLength Maximum size before dropping data.
19 21 */
20 - public function __construct(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $stream, $maxLength)
22 + public function __construct(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $stream, int $maxLength)
21 23 {
22 24 $this->stream = $stream;
23 25 $this->maxLength = $maxLength;
24 26 }
25 - public function write($string)
27 + public function write($string) : int
26 28 {
29 + if (!\is_string($string)) {
30 + \YoastSEO_Vendor\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));
31 + }
27 32 $diff = $this->maxLength - $this->stream->getSize();
28 33 // Begin returning 0 when the underlying stream is too large.
29 34 if ($diff <= 0) {
30 35 return 0;