Download the PHP package alexmanno/pipeline-remix without Composer
On this page you can find all versions of the php package alexmanno/pipeline-remix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexmanno/pipeline-remix
More information about alexmanno/pipeline-remix
Files in alexmanno/pipeline-remix
Package pipeline-remix
Short Description Reinvented pipelines for PHP
License MIT
Homepage http://github.com/alexmanno/pipeline-remix
Informations about the package pipeline-remix
pipeline-remix
Reinvented pipelines for PHP
What's a Pipeline
A pipeline is a set of data processing elements connected in series, where the output of one element is the input of the next one.
Installation
From Composer
To use this package, use Composer:
- from CLI:
composer require alexmanno/pipeline-remix
- or, directly in your
composer.json
:
Architecture
Pipeline
A Pipeline is a simple SplQueue of Stage.
You can initialize it in this way: $pipeline = new AlexManno\Remix\Pipelines\Pipeline();
You can add Stage to Pipeline using $pipeline->pipe($stage)
Stage
A Stage is an object that implements AlexManno\Remix\Pipelines\Interfaces\StageInterface
and has an __invoke()
method.
This object is the smallest part of the pipeline and it should be a single operation.
You can create a class that implements that interface.
Ex.
Payload
Payload is an object that implements PayloadInterface
and can store any kind of data.
For example in a web application it can store Request
and Response
.
Ex.
Compose and run your pipeline
If you have already initialized Payload object and Stages objects you can compose your pipeline.
Ex.
You can also compose two or more pipelines together using method add()
Ex.
Examples
- Using Classes Example-00
Conclusion
I hope you found useful this repo. Thanks for attention.
Made with :heart: by @alexmanno