
PHP's PSR 7 message handling and validation is a crucial aspect of building robust web applications. It provides a standardized way to handle HTTP messages, making it easier to work with different frameworks and libraries.
One key feature of PSR 7 is its ability to validate HTTP requests and responses. This is done through the use of interfaces such as Psr\Http\Message\ServerRequestInterface and Psr\Http\Message\ResponseInterface.
PSR 7's validation capabilities help prevent common issues like missing or malformed data. For example, the Psr\Http\Message\ServerRequestInterface requires the presence of a URI, method, and headers.
Validating HTTP requests and responses also helps ensure that your application behaves correctly in different scenarios, such as when dealing with invalid or missing data. This can save you a lot of debugging time and headaches in the long run.
Request
A request in PHP's PSR 7 is represented by the RequestInterface, which provides a general representation of an HTTP request message. This interface is used to model the request's method and URI.
The RequestInterface composes a UriInterface instance, which models the URI itself, and provides two methods around request-targets: getRequestTarget() and withRequestTarget(). These methods allow you to address non-origin-form requests targets when needed, while keeping the URI information present in the request.
The request interface also provides the ability to introspect the URI, which is treated as a value object, meaning that changing any portion of a URI changes its value. If you want the changes reflected in your request, you'll need to notify the request using the with methods.
Uploaded Files
Uploaded files can be a challenge to work with, especially when dealing with arrays of file inputs. PHP's $_FILES superglobal has some well-known problems when dealing with arrays of file inputs.
If you have a form that submits an array of files, such as "files" submitting files[0] and files[1], PHP will represent this as a nested array instead of the expected structure. This means consumers need to know this language implementation detail and write code to gather the data for a given upload.
In some cases, $_FILES may not be populated when file uploads occur. This can happen when the HTTP method is not POST, when unit testing, or when operating under a non-SAPI environment, such as ReactPHP.
Here are some scenarios where $_FILES may not be populated:
- When the HTTP method is not POST.
- When unit testing.
- When operating under a non-SAPI environment, such as ReactPHP.
To overcome these issues, the getUploadedFiles() method provides a normalized structure for consumers. This method aggregates all information for a given file upload and re-creates the submitted tree structure.
The normalized structure returned by getUploadedFiles() should mimic the naming structure in which files were submitted. For example, if a form submits a single file with the name "file", the structure in $_FILES would look like this:
In this case, the normalized structure returned by getUploadedFiles() would be:
This ensures that consumers can access the uploaded file data in a consistent and predictable way.
In the case of an input using array notation for the name, such as "files[0]" and "files[1]", the structure in $_FILES would look like this:
The normalized structure returned by getUploadedFiles() would be:
For your interest: Php Store Class Name in Variable
This shows how the getUploadedFiles() method can handle arrays of file inputs and provide a consistent structure for consumers to work with.
The UploadedFileInterface provides a method called moveTo($targetPath) which is a safe and recommended alternative to calling move_uploaded_file() directly on the temporary upload file. This method will detect the correct operation to use based on the environment.
Requests
Requests are the foundation of any web application, and understanding how they work is crucial for building robust and scalable systems.
A request typically consists of a method and a URI/request-target. The URI itself is a complex entity that can be broken down into its components, and it's essential to understand how to work with them.
The request interface composes a UriInterface instance, which models the URI itself. This allows you to introspect the URI and understand its components.
Here are the key components of a URI:
- Host
- Path
- Query string arguments
- Form data
- Cookies
The request interface provides two methods around request-targets: getRequestTarget(), which returns the request target, and withRequestTarget(), to create a new instance with a specific request target. This allows you to address non-origin-form request-targets while keeping the URI information present in the request.
You can get the method and URI from the request using the with methods. These methods return a new instance of the request with the updated method or URI. For example, if you want to change the URI, you can use the withUri() method, which will also set the Host header on the returned instance based on the value present in the URI.
See what others are reading: Php Check If Class Is Instance of
Message::ParseMessage
The Message::parseMessage method is a powerful tool for parsing HTTP messages into an associative array. This method reads the entire stream to calculate a rolling hash, based on PHP's hash_init functions.
The resulting array contains three key elements: the start-line, headers, and body of the message. The "start-line" key contains the start line of the message, the "headers" key contains an associative array of header array values, and the "body" key contains the body of the message.
This method is particularly useful for developers who need to work with HTTP messages in their applications. By providing a standardized way to parse HTTP messages, Message::parseMessage helps to simplify the process of working with HTTP requests and responses.
You might enjoy: How Do You Recover Text Messages on Iphone 7
Uri
The Uri class is a crucial part of the PSR-7 standard, allowing you to work with URIs in a standardized way.
A UriInterface instance can be created from a string or another UriInterface instance using GuzzleHttp\Psr7\Utils::uriFor. This function returns a UriInterface instance, which can be used to access the various components of the URI.
The UriInterface instance provides several methods to work with the URI components, including isAbsolute, isDefaultPort, and withoutQueryValue. The isAbsolute method checks if the URI has a scheme, while the isDefaultPort method checks if the URI has the default port of the current scheme. The withoutQueryValue method creates a new URI with a specific query string value removed.
Here are the available normalizations that can be applied to a URI using UriNormalizer::normalize:
- PRESERVING_NORMALIZATIONS: Default normalizations which only include the ones that preserve semantics.
- CAPITALIZE_PERCENT_ENCODING: Capitalize all letters within a percent-encoding triplet.
- DECODE_UNRESERVED_CHARACTERS: Decodes percent-encoded octets of unreserved characters.
- CONVERT_EMPTY_PATH: Converts the empty path to "/" for http and https URIs.
- REMOVE_DEFAULT_HOST: Removes the default host of the given URI scheme from the URI.
- REMOVE_DEFAULT_PORT: Removes the default port of the given URI scheme from the URI.
- REMOVE_DOT_SEGMENTS: Removes unnecessary dot-segments.
- REMOVE_DUPLICATE_SLASHES: Removes duplicate slashes in the path.
- SORT_QUERY_PARAMETERS: Sorts query parameters with their values in alphabetical order.
Uri Compose Components
Uri Compose Components is a method that composes a URI reference string from its various components according to RFC 3986 Section 5.3. This method is usually called indirectly via Psr\Http\Message\UriInterface::__toString.

This method is not typically called manually, but it's used to create a new URI reference string from its components. The components include the scheme, authority, path, query, and fragment.
Here are the components that are used to compose a URI reference string:
- Scheme
- Authority
- Path
- Query
- Fragment
These components are used to create a new URI reference string, which can be used to represent a URI in a more human-readable format.
No Base Path Retrieval Functionality
The logic for determining the base path varies widely between implementations, making it difficult to include a standard function for retrieval.
Most implementations allow manual injection of a base path to the router and/or any facilities used for URI generation, as seen in frameworks like Symfony 2.
Developers usually don't need to be aware of the base path concept, as other objects take care of that detail for them.
The primary use cases for URI generation are routing and URI generation, which are typically the only consumers of the base path functionality.
All sources necessary for calculating the base path are already available in the RequestInterface instance, via server parameters and the URI instance.
The base path detection is framework and/or application specific, and the results of detection can be easily injected into objects that need it.
You might enjoy: Do I Need Php for Submission Form Html
Uri Helper
The GuzzleHttp\Psr7\Utils::uriFor function is a convenient way to get a UriInterface for a given value, whether it's a string or already a UriInterface.
You can use the URI Components methods to work with individual components of a URI. These methods are useful when you need to manipulate specific parts of a URI.
GuzzleHttp\Psr7\Uri::composeComponents is a method that composes a URI reference string from its various components, but it's usually called indirectly via Psr\Http\Message\UriInterface::__toString. This method follows the rules outlined in RFC 3986 Section 5.3.
Uri::WithQueryValues
Uri::withQueryValues is a method that creates a new URI with multiple query string values. It's especially useful when you need to add multiple key-value pairs to a URI's query string.
This method has the same behavior as Uri::withQueryValue, but it accepts an associative array of key-value pairs. This makes it easy to add multiple values to a URI's query string at once.
For example, you can use Uri::withQueryValues to add multiple query string values to a URI. It's a convenient way to build complex URIs with multiple query parameters.
Uri::withQueryValues returns a new URI interface object, leaving the original URI unchanged. This is useful when you need to modify a URI without affecting the original.
See what others are reading: Do I Need Wifi 7
UriComparator IsCrossOrigin

The UriComparator IsCrossOrigin method is a game-changer for determining whether a modified URL should be considered cross-origin with respect to an original URL.
GuzzleHttp\Psr7\UriComparator::isCrossOrigin is the actual method name, and it takes two UriInterface objects as arguments: $original and $modified.
The method returns a boolean value, indicating whether the modified URL should be considered cross-origin.
This is useful for developers working with URLs and need to determine if a URL change affects the origin of the URL.
To use this method, you'll need to create UriInterface objects for the original and modified URLs.
The method will then determine if the modified URL should be considered cross-origin based on the original URL.
UriResolver RemoveDotSegments
UriResolver RemoveDotSegments is a useful method for cleaning up URLs. It removes dot segments from a path and returns the new path according to RFC 3986 Section 5.2.4.
GuzzleHttp\Psr7\UriResolver::removeDotSegments is the actual method name, which might be useful to know if you're digging into the code.

The method takes a string path as input and returns a new string path with dot segments removed. This is a straightforward process that can help prevent issues with URL handling.
I've seen this method in action when working with complex URLs, and it's been a lifesaver in keeping things organized.
Uri::IsRelativePathReference
Uri::isRelativePathReference is a helpful method that determines whether a URI is a relative-path reference.
A relative-path reference is a URI that does not begin with a slash character. This is in contrast to a network-path reference, which starts with two slash characters.
In other words, if a URI starts with a slash, it's not a relative-path reference. If it doesn't, then it is.
Query
Query is a fundamental aspect of HTTP requests, and PHP's PSR-7 implementation provides two key functions to work with query strings: GuzzleHttp\Psr7\Query::parse and GuzzleHttp\Psr7\Query::build.
The parse function takes a query string and returns an associative array. If multiple values are found for the same key, the value becomes an array.
You can use this function to convert query strings into a format that's easy to work with in your PHP code.
For example, if you have a query string like "foo=a&foo=b", the parse function will return an array like ['foo' => ['a', 'b']].
GuzzleHttp\Psr7\Query::build is the inverse of parse, taking an associative array and returning a query string. This function can be used to build a query string from an array of key-value pairs.
It's worth noting that this function does not modify the provided keys when an array is encountered, unlike http_build_query().
Header
PHP PSR 7 is a set of standards for creating HTTP messages in PHP. It provides a common interface for working with HTTP requests and responses.
PSR 7 defines the structure and behavior of HTTP messages, including requests and responses, headers, and bodies. This allows developers to write more portable and maintainable code.
The PSR 7 standard includes interfaces for HTTP messages, such as Psr\Http\Message\RequestInterface and Psr\Http\Message\ResponseInterface. These interfaces define the methods and properties that must be implemented by any class that claims to represent an HTTP message.
Host
The Host header is a crucial part of HTTP requests, and it's essential to understand how it works.
The Host header typically mirrors the host component of the URI, as well as the host used when establishing the TCP connection. However, the HTTP specification allows the Host header to differ from each of the two.
During construction, implementations MUST attempt to set the Host header from a provided URI if no Host header is provided.
You can opt-in to preserving the original state of the Host header by passing true for the second ($preserveHost) argument when using RequestInterface::withUri().
Here's a table illustrating what getHeaderLine('Host') will return for a request returned by withUri() with the $preserveHost argument set to true for various initial requests and URIs:
In the table, you can see that the Host header value prior to operation, the Host component of the URI composed in the request prior to the operation, and the Host component of the URI being injected via withUri() are all taken into account when determining the result.
Cross Origin Detection
Cross Origin Detection is a crucial aspect of working with headers.
GuzzleHttp\Psr7\UriComparator provides methods to determine if a modified URL should be considered cross-origin. This is particularly important in web development, where cross-origin requests can lead to security issues.
In some cases, a modified URL may not be considered cross-origin, even if it looks like it should be. This is because GuzzleHttp\Psr7\UriComparator takes into account various factors to make this determination.
The methods provided by GuzzleHttp\Psr7\UriComparator are designed to help developers avoid common pitfalls related to cross-origin requests. By using these methods, developers can ensure that their applications are secure and functioning as intended.
Server-Side
ServerRequestInterface extends RequestInterface to provide an abstraction around various superglobals, reducing coupling to the superglobals and encouraging testing of request consumers.
Server-side applications have specific considerations for incoming requests, including access to server parameters, query string arguments, parsed body, uploaded files, cookie values, and attributes derived from the request.
The ServerRequestInterface helps solve problems within the PHP language itself, such as inconsistent state due to php://input being read-once, and brittle unit testing against superglobals.
Here are the superglobals provided by PHP for server-side requests:
- $_COOKIE, which deserializes and provides simplified access to HTTP cookies.
- $_GET, which deserializes and provides simplified access to query string arguments.
- $_POST, which deserializes and provides simplified access for urlencoded parameters submitted via HTTP POST.
- $_FILES, which provides serialized metadata around file uploads.
- $_SERVER, which provides access to CGI/SAPI environment variables, commonly including the request method, the request scheme, the request URI, and headers.
Static Api
When working with server-side development, it's essential to understand the Static API.
The GuzzleHttp\Psr7 namespace offers various static methods that can be used to work with streams.
You can access custom metadata using the metadata method.
The size method allows you to get the size of a stream.
A fresh viewpoint: Static Variable in Php Class
1.5 Server-Side Requests
Server-side requests are a crucial aspect of server-side programming, and understanding how they work is essential for building robust and efficient applications.
Server-side requests need additional treatment due to the nature of the server-side environment, and PHP's Server APIs (SAPI) provide a simplification around input marshaling via superglobals.
The RequestInterface provides a general representation of an HTTP request message, but server-side requests require access to server parameters, query string arguments, the parsed body, uploaded files, cookie values, and attributes derived from the request.
The ServerRequestInterface extends the RequestInterface to provide an abstraction around these various superglobals, reducing coupling to the superglobals and encouraging testing of request consumers.
The ServerRequestInterface provides a property called "attributes" that allows consumers to introspect, decompose, and match the request against application-specific rules.
Here's a summary of the superglobals provided by PHP for server-side requests:
- $_COOKIE: deserializes and provides simplified access to HTTP cookies
- $_GET: deserializes and provides simplified access to query string arguments
- $_POST: deserializes and provides simplified access to urlencoded parameters submitted via HTTP POST
- $_FILES: provides serialized metadata around file uploads
- $_SERVER: provides access to CGI/SAPI environment variables, including the request method, scheme, URI, and headers
The ServerRequestInterface provides a method called getRequestTarget() that returns the request target, and a method called withRequestTarget() that creates a new instance with a specific request target.
Header::Normalize (Deprecated)
Header::Normalize (Deprecated) is a method that's no longer recommended for use in favor of a newer alternative.
The method was used to convert an array of header values that may contain comma-separated headers into an array of headers with no comma-separated values.
This method is now deprecated in favor of Header::splitList(), which performs the same operation with a cleaned up API and improved documentation.
Header::splitList() is the new go-to method for this task, and it's recommended to use it instead of Header::normalize() to avoid any potential issues.
Inflate

Inflate is a crucial concept in server-side development, and it's used to inflate zlib or gzipped content.
GuzzleHttp\Psr7\InflateStream uses PHP's zlib.inflate filter to inflate content. This stream decorator converts the provided stream to a PHP stream resource, then appends the zlib.inflate filter.
The InflateStream class has several methods that can be used to customize the behavior of the inflate operation. Some of these methods include setting the HTTP method, setting headers, and removing headers.
Here are some of the methods available in the InflateStream class:
- method: (string) Changes the HTTP method.
- set_headers: (array) Sets the given headers.
- remove_headers: (array) Remove the given headers.
- body: (mixed) Sets the given body.
- uri: (UriInterface) Set the URI.
- query: (string) Set the query string value of the URI.
- version: (string) Set the protocol version.
The InflateStream class is a powerful tool for working with compressed content in server-side development.
Methods
The message itself is a container for the headers, and there are methods to access them in a uniform way. This is a responsibility of the message, and the RequestInterface has methods for it.
The withRequestTarget() method allows specifying a custom request-target, while the composed URI is used to present an origin-form request-target by default. This is useful for creating requests with specific request-target forms.
Having methods like these allows HTTP clients to build a base request with data such as the base URI and required headers, without needing to build a brand new request or reset request state for each message.
Append
Append is a method that allows you to read from multiple streams one after the other. This is particularly useful when working with large amounts of data.
GuzzleHttp\Psr7\AppendStream is a specific implementation of this method, designed for reading from multiple streams in sequence. It's a powerful tool for handling complex data streams.
One example of Append in action is reading from multiple streams, one after the other, which can be useful for handling large amounts of data. This can be particularly helpful when dealing with data that's stored across multiple files or streams.
If this caught your attention, see: One Ui 7 Update Samsung Devices
Multipart
Multipart is a method that allows you to handle multipart streams.
GuzzleHttp\Psr7\MultipartStream is a class that enables this functionality.
This class returns bytes when read, specifically for streaming multipart or multipart/form-data streams.
Value Objects
Value Objects provide several benefits when modeling HTTP messages. Changes in URI state cannot alter the request composing the URI instance. Changes in headers cannot alter the message composing them.
Value objects ensure the integrity of the message state, and prevent the need for bi-directional dependencies, which can often go out-of-sync or lead to debugging or performance issues. This practice has a side benefit of making explicit any changes to application state being made.
Here are some benefits of using value objects:
- The original request state can be stored for retrieval by any consumer.
- A default response state can be created with default headers and/or message body.
Package
The package that provides the interfaces and classes for PSR-7 is psr/http-message.
This package is a collection of interfaces and classes that are designed to work together to create a standardized way of handling HTTP messages in PHP.
The psr/http-message package is the foundation for many other packages that build upon its functionality.
You can use the GuzzleHttp\Psr7\StreamWrapper class if you need to use a PSR-7 stream as a PHP stream resource.
This class provides a way to create a PHP stream from a PSR-7 stream, which can be useful in certain situations.
The GuzzleHttp\Psr7\StreamWrapper::getResource() method is used to create a PHP stream from a PSR-7 stream.
GetUploadedFiles returns objects, not arrays
In some frameworks, getUploadedFiles() returns objects instead of arrays. This is primarily done to simplify specification.
The data in an UploadedFileInterface is normalized to work in both SAPI and non-SAPI environments. This allows for proper handling of file uploads in SAPI environments.
This approach enables the creation of processes to parse the message body manually and assign contents to streams without first writing to the filesystem.
MimeType::FromExtension
MimeType::FromExtension is a static function that maps a file extension to a mimetype. It's a convenient way to determine the type of a file based on its extension, rather than its actual contents.
The function is part of the GuzzleHttp\Psr7\MimeType class and is used in conjunction with the fromFilename method, which determines the mimetype of a file by looking at its extension.
You can use MimeType::FromExtension to get the mimetype of a file, given its extension. For example, if you have a file with the extension '.txt', calling MimeType::FromExtension('.txt') would return the mimetype 'text/plain'.
This function is useful when you need to handle files of different types, and you know the extension but not the actual file contents. It's a simple and efficient way to get the mimetype of a file based on its extension.
Normalization and Comparison
Normalization and Comparison is a crucial aspect of Value Objects, and it's great to see that GuzzleHttp\Psr7\UriNormalizer provides methods to normalize and compare URIs according to RFC 3986 Section 6.
Normalization involves standardizing the format of a URI, making it easier to compare and work with. In the case of GuzzleHttp\Psr7\UriNormalizer, it provides methods to add additional normalizations that can be configured with the $flags parameter, which is a bitmask of normalizations to apply.
Here are the available normalizations:
- UriNormalizer::PRESERVING_NORMALIZATIONS - Default normalizations which only include the ones that preserve semantics.
- UriNormalizer::CAPITALIZE_PERCENT_ENCODING - Capitalizes letters within a percent-encoding triplet.
- UriNormalizer::DECODE_UNRESERVED_CHARACTERS - Decodes percent-encoded octets of unreserved characters.
- UriNormalizer::CONVERT_EMPTY_PATH - Converts the empty path to "/" for http and https URIs.
- UriNormalizer::REMOVE_DEFAULT_HOST - Removes the default host of the given URI scheme from the URI.
- UriNormalizer::REMOVE_DEFAULT_PORT - Removes the default port of the given URI scheme from the URI.
- UriNormalizer::REMOVE_DOT_SEGMENTS - Removes unnecessary dot-segments.
- UriNormalizer::REMOVE_DUPLICATE_SLASHES - Converts paths which include two or more adjacent slashes to one.
- UriNormalizer::SORT_QUERY_PARAMETERS - Sorts query parameters with their values in alphabetical order.
These normalizations can be combined using the $flags parameter to achieve the desired level of normalization. For example, you can use UriNormalizer::PRESERVING_NORMALIZATIONS and UriNormalizer::CAPITALIZE_PERCENT_ENCODING to preserve semantics while capitalizing letters within percent-encoding triplets.
Using an Iterator for Content?
Ruby's Rack implementation uses an iterator-based approach for server-side response message bodies.
This approach can be emulated using an HTTP message paradigm via an iterator-backed StreamInterface approach, as detailed in the psr7examples repository.
GuzzleHttp\Psr7\LazyOpenStream is a class that lazily reads or writes to a file that is opened only after an IO operation takes place on the stream.

This means you don't need to open the file until you actually need to read or write to it, which can be a big performance boost in some cases.
In Ruby's Rack implementation, using an iterator for content allows for more efficient handling of large datasets.
By only reading or writing to the file as needed, you can avoid loading the entire file into memory at once.
Value Objects
Value objects are a fundamental concept in software development, and they're particularly useful when modeling HTTP messages. URIs are values with identity defined by the value, and they should be modeled as value objects.
This allows parsing once only and simplifies access to individual segments. It also provides convenience in client applications by allowing users to create new instances of a base URI instance with only the segments that change.
Value objects provide several benefits when modeling HTTP messages, including changes in URI state cannot alter the request composing the URI instance, and changes in headers cannot alter the message composing them.
Here are some key benefits of using value objects:
- Changes in URI state cannot alter the request composing the URI instance.
- Changes in headers cannot alter the message composing them.
Modeling HTTP messages as value objects ensures the integrity of the message state and prevents the need for bi-directional dependencies, which can often go out-of-sync or lead to debugging or performance issues.
Value objects also enable some interesting use cases, such as creating base instances of requests and URIs, and creating discrete requests and URIs from them.
Buffer
Buffer is a special type of stream that allows you to fill a buffer and then remove bytes from it.
This stream can be written to fill a buffer, and read from to remove bytes from the buffer.
A BufferStream returns a "hwm" metadata value that tells upstream consumers the maximum preferred size of the buffer.
This metadata value is also known as the high water mark of the stream.
Consider reading: How to Uninstall Apps on Iphone 7
Validation
, or any character less than or equal to 0x20.
If you're building an application that needs to be compatible with older systems, you might want to consider accepting the sequence \r
(0x0D0A) within a header value, but only if it's immediately followed by either SPACE (0x20) or \t (0x09).
A validator should reject header values containing NUL, \r, or
. To ensure compatibility with older systems, you can normalize the sequence \r
(0x0D0A) to a single SPACE (0x20) if it's followed by either SPACE (0x20) or \t (0x09).
7.1 Validation
Validation is crucial in HTTP headers to prevent security vulnerabilities and misparsing. A common type of vulnerability is CRLF injection, which can be used to inject additional headers or end the list of headers early.
To validate header names and values, classes implementing the MessageInterface SHOULD strictly follow the most recent HTTP specification (RFC 7230#3.2). This ensures that the contents of unrelated headers are not changed.
A minimally viable validator should reject header names containing certain characters, including NUL (0x00), \r (0x0D),
(0x0A), and any character less than or equal to 0x20.
Here are the specific characters that should be rejected in header names:
- NUL (0x00)
- \r (0x0D)
(0x0A)Any character less than or equal to 0x20.
Header values should also be validated, rejecting characters such as NUL (0x00), \r (0x0D), and
(0x0A). However, the sequence \r
(0x0D0A) within a header value MAY be accepted if it is immediately followed by either SPACE (0x20) or \t (0x09).
Dropping

Dropping is a validation technique that helps prevent data overload.
A key tool for dropping data is the DroppingStream, which is a stream decorator that begins dropping data once the size of the underlying stream becomes too full.
This can be particularly useful when working with large amounts of data, as it prevents the system from crashing due to data overload.
Decorators
You can create a stream decorator using the GuzzleHttp\Psr7\StreamDecoratorTrait, which makes it easy to implement Psr\Http\Message\StreamInterface by proxying to an underlying stream.
This trait provides a way to add custom functionality to existing streams by overriding methods like read().
For example, you can call a specific function each time the last byte is read from a stream by overriding the read() method.
The decorator can be added to any existing stream and used like a regular stream.
It's a great way to add custom behavior to streams without modifying their underlying implementation.
Features
The PHP PSR 7 package is a powerful tool that offers a range of features to make your development process smoother.
This package comes with a number of stream implementations and stream decorators.
Featured Images: pexels.com


