yuna / flow
1.1.0
2025-10-23 16:03 UTC
Requires
- php: >=8.2
- psr/log: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.88
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.4
README
Pipeline Builder in PHP.
Features:
- easy to use interfaces
- simple to use
- reusable
- configurable
- fully in PHP (no other extension is supported)
Installation
composer require yuna/flow:^1
Example
<?php
use Yuna\Flow\Config;
use Yuna\Flow\Context;
use Yuna\Flow\Environment;
use Yuna\Flow\FlowBuilder;
use Yuna\Flow\InlineStep;
use Yuna\Flow\Logger;
use Yuna\Flow\Result;
require_once __DIR__ . '/vendor/autoload.php';
$config = new Config();
$context = new Context($config, new Environment($_ENV), new Logger());
$exitCode = (new FlowBuilder($context))
->addStep((new InlineStep('Hello', function (Context $context) {
$context->getLogger()?->info('something here');
return new Result(true);
})))
->addStep((new InlineStep('World', function (Context $context) {
$context->getLogger()?->info('will error');
return new Result(false);
})))
->create()
->run();
exit($exitCode);
Code above will output:
[INFO] Running "Hello"...
[INFO] something here
[INFO] Running "World"...
[INFO] will error
with exit code 1 (because result is false)