Many thanks to the private reviewers and collaborators on this project thus far. Special thanks to Nathan Bishop for starting this project, and for his generous donation of the Github organization and the Packagist vendor space. Special thanks also to Akihito Koriyama for his encouragement and advice on this and related *-interop projects.

After a period of private review, the stream-interop/interface package is now open for public review.

Stream-Interop publishes interoperable interfaces providing a more object-oriented approach to encapsulating and interacting with stream resources in PHP 8.4+. It reflects, refines, and reconciles the common practices identified within several pre-existing projects.

The package defines separate interfaces for various affordances around stream resources so that (1) implementations can advertise well-tailored affordances, and (2) consumers can typehint to the specific affordances they require for specific situations:

The reference implementations demonstrate how the interfaces can be combined in various ways to implement everything from a simple ConsumableFileStream to a lazy ghost ReadWriteFile.

If you use streams and are interested an interoperable set of interfaces, please offer your comments and criticism as issues or PRs out at Github.

Are you stuck with a legacy PHP application? You should buy my book because it gives you a step-by-step guide to improving you codebase, all while keeping it running the whole time.