Skip to content

Add ResourceStream encoder and decoder#50

Merged
veewee merged 1 commit intophpro:v2.xfrom
veewee:resource-stream
Apr 2, 2026
Merged

Add ResourceStream encoder and decoder#50
veewee merged 1 commit intophpro:v2.xfrom
veewee:resource-stream

Conversation

@veewee
Copy link
Copy Markdown
Contributor

@veewee veewee commented Apr 2, 2026

Summary

  • Adds ResourceStreamEncoder (EncoderInterface<ResourceStream>) that converts a phpro/resource-stream ResourceStream to a PSR-7 request body
  • Adds ResourceStreamDecoder (DecoderInterface<ResourceStream>) that wraps a PSR-7 response body into a ResourceStream
  • Updates docs/transports.md with the new encodings

Test plan

  • Unit tests for encoder (body content, no Content-Type header set)
  • Unit tests for decoder (response body wrapped into ResourceStream)
  • Psalm passes
  • PHP-CS-Fixer passes
  • 100% code coverage maintained

Introduce encoding support for phpro/resource-stream, bridging
ResourceStream with the PSR-7 HTTP layer. The encoder converts
a ResourceStream to a PSR-7 request body, the decoder wraps a
PSR-7 response body into a ResourceStream.
@veewee veewee force-pushed the resource-stream branch from 4d3052e to c41e144 Compare April 2, 2026 06:49
@veewee veewee merged commit 0a83c7d into phpro:v2.x Apr 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant