1. Go to this page and download the library: Download gandung/pipeline library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Gandung\Pipeline\Pipeline;
use Gandung\Pipeline\Tests\Fixtures\FooTask;
use Gandung\Pipeline\Tests\Fixtures\BarTask;
use Gandung\Pipeline\Tests\Fixtures\BazTask;
// Instance based task. Class instance must implements __invoke and TaskInterface class interface.
$pipe = (new Pipeline)
->pipe(new FooTask)
->pipe(new BarTask)
->pipe(new BazTask);
$payload = $pipe->invokeAll('foo');
echo sprintf("%s\n", $payload);
use Gandung\Pipeline\PipelineBuilder;
use Gandung\Pipeline\Tests\Fixtures\FooTask;
use Gandung\Pipeline\Tests\Fixtures\BarTask;
use Gandung\Pipeline\Tests\Fixtures\BazTask;
// Instance based task. Class instance must implements __invoke and TaskInterface class interface.
$builder = (new PipelineBuilder)
->add(new FooTask)
->add(new BarTask)
->add(new BazTask);
$pipe = $builder->build();
$payload = $pipe->invokeAll('foo');
echo sprintf("%s\n", $payload);