Skip to content

vkartaviy/pipes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipes

The library for data flow processing.

Build Status

Here is a simple example:

<?php

use Pipes\Iterator\Pipeline;
use Pipes\Iterator\Pipe\RenumberPipe;
use Pipes\Iterator\Pipe\TransformPipe;
use Pipes\Iterator\Pipe\DuplicateFilterPipe;
use Pipes\Iterator\Pipe\FilterPipe;

require __DIR__.'/../vendor/autoload.php';

$input = array(1, 1, 2, 2, 3, 3, 4, 4);

$pipeline = new Pipeline($input, array(
    new DuplicateFilterPipe(),
    new FilterPipe(function ($value) { return $value % 2 === 0; }),
    new TransformPipe(function ($value) { return $value / 2; }),
    new RenumberPipe()
));

foreach ($pipeline as $key => $value) {
    echo "{$key} => {$value}\n";
}

About

The library for data flow processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages