| 1 | <?php |
||
| 7 | class PipelineBuilder implements PipelineBuilderInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var callable[] |
||
| 11 | */ |
||
| 12 | protected $stages = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var ProcessorInterface |
||
| 16 | */ |
||
| 17 | private $processr; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var BuilderInterface |
||
| 21 | */ |
||
| 22 | private $last; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Add an stage. |
||
| 26 | * |
||
| 27 | * @param callable $stage |
||
| 28 | * |
||
| 29 | * @return $this |
||
| 30 | */ |
||
| 31 | 6 | public function pipe(callable $stage) |
|
| 38 | |||
| 39 | 2 | public function fork(callable $resolver) |
|
| 45 | |||
| 46 | public function processor(ProcessorInterface $processor) |
||
| 50 | |||
| 51 | 8 | private function buildLast() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * Build a new Pipeline object |
||
| 60 | * |
||
| 61 | * @return Pipeline |
||
| 62 | */ |
||
| 63 | 4 | public function build() |
|
| 68 | } |
||
| 69 |