PHPackages                             kuyoto/psr7-streams - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. kuyoto/psr7-streams

ActiveLibrary[HTTP &amp; Networking](/categories/http)

kuyoto/psr7-streams
===================

Provides PSR-7 stream decorators.

v1.0.0(5y ago)02MITPHPPHP ^7.2CI failing

Since Jun 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kuyoto/psr7-streams)[ Packagist](https://packagist.org/packages/kuyoto/psr7-streams)[ RSS](/packages/kuyoto-psr7-streams/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

PSR-7 Streams
=============

[](#psr-7-streams)

[![Build Status](https://camo.githubusercontent.com/ade7398cf292435acecd27598df74f785281127c47199c69a3764f85bdb2412c/68747470733a2f2f7472617669732d63692e6f72672f6b75796f746f2f707372372d73747265616d732e7376673f623d6d6173746572)](https://travis-ci.org/kuyoto/psr7-streams)[![Latest Stable Version](https://camo.githubusercontent.com/660eb9e49d8a959270f7efc53e64ededb4364589b7e4e2c54e885225a0bdc359/68747470733a2f2f706f7365722e707567782e6f72672f6b75796f746f2f707372372d73747265616d732f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/kuyoto/psr7-streams)[![License](https://camo.githubusercontent.com/a91eb231bae62419e41abcc28df8ad0bf8d21d35f3d49e0776de78213469eacb/68747470733a2f2f706f7365722e707567782e6f72672f6b75796f746f2f707372372d73747265616d732f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/kuyoto/psr7-streams)

This repository provides several [PSR-7](http://www.php-fig.org/psr/psr-7/) stream decorators.

Installation
------------

[](#installation)

The recommnended way to install this library is through [composer](https://getcomposer.org):

```
composer require kuyoto/psr7-streams
```

Stream Decorators
-----------------

[](#stream-decorators)

This library consists of the following `Psr\Http\Message\StreamInterface` impementations:

### ConcatenatedStream

[](#concatenatedstream)

`Kuyoto\Psr7\Stream\ConcatenatedStream`

Reads from multiple streams, one after the other.

```
use Kuyoto\Psr7\Stream\StringStream;
use Kuyoto\Psr7\Stream\ConcatenatedStream;

$a = new StringStream('foo');
$b = new StringStream('bar');

$composed = new ConcatenatedStream([$a, $b]);

echo $composed; // foobar.
```

### NoSeekStream

[](#noseekstream)

`Kuyoto\Psr7\Stream\NoSeekStream`

It wraps a stream and does not allow seeking.

```
use Kuyoto\Psr7\Stream\StringStream;
use Kuyoto\Psr7\Stream\NoSeekStream;

$stream = new StringStream('foo');
$noSeek = new NoSeekStream($stream);

echo $noSeek->read(3); // foo

var_export($noSeek->isSeekable()); // false

$noSeek->seek(0);

var_export($noSeek->read(3)); // NULL
```

### NullStream

[](#nullstream)

`Kuyoto\Psr7\Stream\NullStream`

NullStream does not store any data written to it.

```
use Kuyoto\Psr7\Stream\NullStream;

$stream = new NullStream();

echo $stream->read(3); // ''
var_export($stream->getSize()); // NULL
```

### StringStream

[](#stringstream)

`Kuyoto\Psr7\Stream\StringStream`

StringStream allows instantiation of a stream from a the provided string.

```
use Kuyoto\Psr7\Stream\StringStream;

$stream = new StringStream('foo');

echo $stream->read(2); // fo

var_export($stream->getSize()); // 3
```

Implementing Stream Decorators
------------------------------

[](#implementing-stream-decorators)

Creating a stream decorator is very easy thanks to the `Kuyoto\Psr7\Stream\StreamDecorator`. This decorator provides methods that implement `Psr\Http\Message\StreamInterface` by proxying to an underlying stream. Just `use` the `StreamDecoratorTrait` and implement your custom methods.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The package is an open-sourced software licensed under the [MIT License](LICENSE).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2143d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41d7599877e958842cf173cf1265fabd845006ccd14becaacd12b63c5a28ccd1?d=identicon)[nikuyo](/maintainers/nikuyo)

---

Top Contributors

[![kuyoto](https://avatars.githubusercontent.com/u/55682776?v=4)](https://github.com/kuyoto "kuyoto (9 commits)")

---

Tags

psrpsr-7streamdecoratorsStreams

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/kuyoto-psr7-streams/health.svg)

```
[![Health](https://phpackages.com/badges/kuyoto-psr7-streams/health.svg)](https://phpackages.com/packages/kuyoto-psr7-streams)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[laminas/laminas-diactoros

PSR HTTP Message implementations

546105.8M964](/packages/laminas-laminas-diactoros)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M919](/packages/psr-http-server-handler)[psr/http-server-middleware

Common interface for HTTP server-side middleware

18091.2M1.5k](/packages/psr-http-server-middleware)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
