提交
This commit is contained in:
34
vendor/alibabacloud/oss-v2/tests/UnitTests/Fixtures/RewindStatStream.php
vendored
Normal file
34
vendor/alibabacloud/oss-v2/tests/UnitTests/Fixtures/RewindStatStream.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace UnitTests\Fixtures;
|
||||
|
||||
use GuzzleHttp;
|
||||
|
||||
/**
|
||||
* Stream decorator that prevents a stream from rewind.
|
||||
*/
|
||||
final class RewindStatStream implements \Psr\Http\Message\StreamInterface
|
||||
{
|
||||
use GuzzleHttp\Psr7\StreamDecoratorTrait;
|
||||
|
||||
/** @var \Psr\Http\Message\StreamInterface */
|
||||
private $stream;
|
||||
|
||||
private int $rewindCount = 0;
|
||||
|
||||
public function rewind(): void
|
||||
{
|
||||
$this->rewindCount++;
|
||||
$this->stream->rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of rewindCount
|
||||
*/
|
||||
public function getRewindCount()
|
||||
{
|
||||
return $this->rewindCount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user