ancarda/psr7-string-stream

Minimal string based PSR-7 StreamInterface implementation

Maintainers

👁 ancarda

Package info

github.com/ancarda/psr7-string-stream

pkg:composer/ancarda/psr7-string-stream

Statistics

Installs: 119 536

Dependents: 6

Suggesters: 0

Stars: 2

1.4 2025-05-24 17:24 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8726da8a86b719051bd4da7cff4c928f2f41ede7

This package is auto-updated.

Last update: 2026-06-26 14:25:50 UTC


README

Minimal string based PSR-7 StreamInterface implementation

👁 License
👁 Latest Stable Version
👁 Total Downloads
👁 builds.sr.ht status

PSR-7 String Stream was born out of frustration working with PSR-7's StreamInterface. Most implementations typically use PHP Streams, which aren't the best to work with. I've run into bugs where harmless operations on Requests, such as withHeaders causes the underlying Body's destructor to be called, which closes the underlying stream. Since resources can't be cloned, this can cause the body to be destroyed.

This package, as the name implies, implements StreamInterface using strings which will survive clone+destroy.

If you're using this in production,

composer require ancarda/psr7-string-stream

If you're just using this in functional or unit tests, it can go in your require-dev section:

composer require --dev ancarda/psr7-string-stream

Useful Links