PHP code example of solution10 / pipeline

1. Go to this page and download the library: Download solution10/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/ */

    

solution10 / pipeline example snippets




use Solution10\Pipeline\Pipeline;

$w = (new Pipeline())
    ->step('double', function ($input) {
        return $input * 2;
    })
    ->step('add-one', function ($input) {
        return $input + 1;
    })
    ->step('stringify', function ($input) {
        return 'Result: '.$input;
    })
;

$result = $w->run(2);
// $result is "Result: 5"