Skip to content

Commit

Permalink
Fix deprecation warnings in PHP 8.2 (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jun 20, 2022
1 parent 83260bb commit b4719a1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/CachingStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ final class CachingStream implements StreamInterface
/** @var int Number of bytes to skip reading due to a write on the buffer */
private $skipReadBytes = 0;

/**
* @var StreamInterface
*/
private $stream;

/**
* We will treat the buffer object as the body of the stream
*
Expand Down
3 changes: 3 additions & 0 deletions src/DroppingStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ final class DroppingStream implements StreamInterface
/** @var int */
private $maxLength;

/** @var StreamInterface */
private $stream;

/**
* @param StreamInterface $stream Underlying stream to decorate.
* @param int $maxLength Maximum size before dropping data.
Expand Down
1 change: 1 addition & 0 deletions src/FnStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Allows for easy testing and extension of a provided stream without needing
* to create a concrete class for a simple extension point.
*/
#[\AllowDynamicProperties]
final class FnStream implements StreamInterface
{
private const SLOTS = [
Expand Down
3 changes: 3 additions & 0 deletions src/InflateStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ final class InflateStream implements StreamInterface
{
use StreamDecoratorTrait;

/** @var StreamInterface */
private $stream;

public function __construct(StreamInterface $stream)
{
$resource = StreamWrapper::getResource($stream);
Expand Down
1 change: 1 addition & 0 deletions src/LazyOpenStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Lazily reads or writes to a file that is opened only after an IO operation
* take place on the stream.
*/
#[\AllowDynamicProperties]
final class LazyOpenStream implements StreamInterface
{
use StreamDecoratorTrait;
Expand Down
3 changes: 3 additions & 0 deletions src/LimitStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ final class LimitStream implements StreamInterface
/** @var int Limit the number of bytes that can be read */
private $limit;

/** @var StreamInterface */
private $stream;

/**
* @param StreamInterface $stream Stream to wrap
* @param int $limit Total number of bytes to allow to be read
Expand Down
3 changes: 3 additions & 0 deletions src/MultipartStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ final class MultipartStream implements StreamInterface
/** @var string */
private $boundary;

/** @var StreamInterface */
private $stream;

/**
* @param array $elements Array of associative arrays, each containing a
* required "name" key mapping to the form field,
Expand Down
3 changes: 3 additions & 0 deletions src/NoSeekStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ final class NoSeekStream implements StreamInterface
{
use StreamDecoratorTrait;

/** @var StreamInterface */
private $stream;

public function seek($offset, $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a NoSeekStream');
Expand Down
3 changes: 3 additions & 0 deletions tests/StreamDecoratorTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
class Str implements StreamInterface
{
use StreamDecoratorTrait;

/** @var StreamInterface */
private $stream;
}

/**
Expand Down

0 comments on commit b4719a1

Please sign in to comment.