A PHP implementation of the pipeline pattern for composing sequential processing stages.
League\Pipeline is a PHP package that provides a clean, reusable implementation of the pipeline pattern. It allows developers to chain sequential processing stages, making complex workflows more modular and maintainable by emphasizing immutability and composability.
PHP developers building applications with sequential processing workflows, such as API request handling, data transformation pipelines, or multi-step business logic.
Developers choose this package for its immutable pipeline design, which minimizes side-effects and enables reuse, and its flexibility in allowing any callable as a stage, including closures, invokable classes, or nested pipelines.
League\Pipeline
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Pipelines are immutable stage chains; adding a stage creates a new pipeline, minimizing side-effects and enabling easy reuse, as highlighted in the README's 'Immutability' section.
Stages can be any callable, including closures, invokable classes, or classes implementing StageInterface, allowing seamless integration with existing PHP code, as demonstrated in the 'Usage' examples.
Pipelines can be nested as stages within other pipelines, enabling complex, modular workflows, with the README showing how to reuse pipelines in API processing scenarios.
PipelineBuilder facilitates collecting stages before construction, useful for distributed setup, as explained in the 'Pipeline Builders' section.
The package is completely transparent with exceptions, not catching or silencing them, requiring developers to handle errors individually in stages or calling code, which can increase boilerplate.
Limited to linear stage execution without support for branching, parallel flows, or conditional logic, making it unsuitable for concurrent task management.
Lacks built-in features like logging, progress tracking, or persistence, which might necessitate additional libraries or custom code for complex enterprise workflows.