PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
← All changes | includes/sdk/s3/GuzzleHttp/Psr7/DroppingStream.php +7 -5 1.2.8 → 1.4.2 View file →
@@ -1,6 +1,7 @@
1 1 <?php
2 2
3 +declare (strict_types=1);
3 4 namespace Dudlewebs\WPMCS\s3\GuzzleHttp\Psr7;
4 5
5 6 use Dudlewebs\WPMCS\s3\Psr\Http\Message\StreamInterface;
6 7 /**
@@ -5,25 +6,26 @@
5 6 use Dudlewebs\WPMCS\s3\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 StreamInterface
11 +final class DroppingStream implements 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(StreamInterface $stream, $maxLength)
22 + public function __construct(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 {
27 29 $diff = $this->maxLength - $this->stream->getSize();
28 30 // Begin returning 0 when the underlying stream is too large.
29 31 if ($diff <= 0) {