yuna/flow

Maintainers

Details

codeberg.org/yuna/flow

Installs: 54

Dependents: 2

Suggesters: 0

Security: 0

pkg:composer/yuna/flow

3.0.6 2025-11-24 18:33 UTC

This package is auto-updated.

Last update: 2025-11-24 18:34:39 UTC


README

Pipeline Builder in PHP.

Features:

  • simple to use
  • reusable
  • configurable
  • supports YAML and PHP configuration

Installation

composer require yuna/flow:^3

Sample

In the sample below we can see example of usage - how to create pipeline and run it.

<?php
// flow.php

use function Yuna\Flow\env;
use function Yuna\Flow\param;

putenv('TEST_VAR_1=VALUE_ENV');

return [
//    'extensions' => [
//        YourExtension::class
//    ],
    'parameters' => [
        'test_1' => true,
        'test_2' => env('TEST_VAR_1'),
        'test_3' => param('test_1')
    ],
    'steps' => [
        [
            'label' => 'Print compiled parameters',
            'type' => '@yuna/debug-print-compiled-parameters'
        ],
        [
            'label' => 'Print compiled steps',
            'type' => '@yuna/debug-print-compiled-steps'
        ]
    ]
];

Now, we will run this configuration with command below:

vendor/bin/flow

Code above will output:

flow.INFO: running step "Print compiled parameters"... {"label":"Print compiled parameters"} 
flow.INFO: {  
flow.INFO:     "test_1": true,  
flow.INFO:     "test_2": "VALUE_ENV",  
flow.INFO:     "test_3": true  
flow.INFO: }  
flow.INFO: running step "Print compiled steps"... {"label":"Print compiled steps"} 
flow.INFO: [  
flow.INFO:     {  
flow.INFO:         "label": "Print compiled parameters",  
flow.INFO:         "type": "@yuna/debug-print-compiled-parameters"  
flow.INFO:     },  
flow.INFO:     {  
flow.INFO:         "label": "Print compiled steps",  
flow.INFO:         "type": "@yuna/debug-print-compiled-steps"  
flow.INFO:     }  
flow.INFO: ]

with exit code 0

Creating your own steps

Example of you own steps are provided in the bultin DebugExtension.

License

MIT