A pipeline implementation for square one
This is a customized implementation of Laravel's illuminate/pipeline to work with PHP-DI and to allow passing additional parameters to your stages.
This system is what powers Laravel's Middleware under the hood and is very useful if you want to run multiple operations in a sequence on the same data set.
Each stage can perform a specific operation, or decide to skip that operation based on some condition and pass the data to the next stage in line.
See the integration tests for some basic example use cases.
- As request/response middleware or any middleware.
- As a filter/facet system, e.g. building a query based on a number of selectable parameters: sort/order, post status, date etc...
- As an access control system, allowing access by role or a number of different conditions.
- As a formatting/transforming/data mapping system.
- As a sanitizing system, performing different sanitization techniques based on the structure of the data.