teewurst / pipeline-bundle
Symfony bundle for teewurst/pipeline
Installs: 1 305
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- symfony/dependency-injection: ^4.4 || ^5.3 || ^6.0 || ^7.0
- symfony/http-kernel: ^4.4 || ^5.3 || ^6.0 || ^7.0
- teewurst/pipeline: ^2.0.2||^3.0.0
README
Installation
Require the package and configure the bundle.
If you are using
symfony/flex
you don't have to do anything.
composer require teewurst/pipeline-bundle
Config without symfony/flex
Go to your config/bundles.php
and add the following line
<?php return [ ... Teewurst\PipelineBundle\PipelineBundle::class => ['all' => true], ];
How to use
You are now able to use the pipeline service as factory for recursive and complex pipelines.
The example at teewurst\pipeline could be represented as:
Example teewurst/pipeline:^2
My\App\MyPipeline: factory: ['@teewurst\pipeline\PipelineService', create] arguments: # First Argument an array of <TaskInterface|array<TaskInterface|array<...>>> $tasks: - '@My\App\CheckServiceAvailabilityTask' - - '@My\App\ErrorHandlerTask' # catch execution of submission even on error - - '@My\App\PrepareDataTask' - '@My\App\ValidateDataTask' - '@My\App\DoGetOfferRequestTask' # .. some additional things like set quote, upload documents etc. - - '@My\App\LogResultLocalyTask' - '@My\App\LogResultInDWTask' # Symfony is not able to handle $options as obejct # you need to write a factory itself
Example teewurst/pipeline:^3
My\App\MyPipeline: factory: ['@teewurst\pipeline\PipelineService', create] arguments: # First Argument an array of <TaskInterface|array<TaskInterface|array<...>>> $tasks: - '@My\App\CheckServiceAvailabilityTask' - - '@My\App\ErrorHandlerTask' # catch execution of submission even on error - - '@My\App\PrepareDataTask' - '@My\App\ValidateDataTask' - '@My\App\DoGetOfferRequestTask' # .. some additional things like set quote, upload documents etc. - - '@My\App\LogResultLocalyTask' - '@My\App\LogResultInDWTask' # Options array to pass pipeline $classFqn: My\App\MyPipeline $options: # only usable from Pipeline 3.0.0 - any - options