yuna/flow

Maintainers

Details

codeberg.org/yuna/flow

Installs: 22

Dependents: 2

Suggesters: 0

Security: 0

pkg:composer/yuna/flow

1.1.0 2025-10-23 16:03 UTC

This package is not auto-updated.

Last update: 2025-10-23 16:04:58 UTC


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)

License

MIT