ancarda / psr7-string-stream
Minimal string based PSR-7 StreamInterface implementation
Requires
- php: ^7.3|^8.0
- psr/http-message: ^1.0
Requires (Dev)
- ancarda/coverage-enforcer: ^1.0
- composer/package-versions-deprecated: 1.11.99.1
- infection/infection: ^0.18.2
- phpstan/phpstan: ^0.12.82
- phpstan/phpstan-phpunit: ^0.12.18
- phpstan/phpstan-strict-rules: ^0.12.9
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
README
Minimal string based PSR-7 StreamInterface implementation
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
- Source Code: https://git.sr.ht/~ancarda/psr7-string-stream/
- Issue Tracker: https://todo.sr.ht/~ancarda/psr7-string-stream/
- Mailing List: https://lists.sr.ht/~ancarda/psr7-string-stream/