Skip to content

Commit

Permalink
Steps are now executed in a reversed order, Fix portphp/portphp#25
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Jul 12, 2015
1 parent fb247cc commit 94d3477
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/StepAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ private function buildPipeline()
$steps->insert(new Step\WriterStep($writer), -256);
}

$steps = iterator_to_array($steps);
$steps = array_reverse($steps);

foreach ($steps as $step) {
$nextCallable = function ($item) use ($step, $nextCallable) {
return $step->process($item, $nextCallable);
Expand Down

0 comments on commit 94d3477

Please sign in to comment.