Skip to content

teewurst/pipeline-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teewurst/pipeline-bundle

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages