Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 2, 2019
1 parent d4affa8 commit d489ffe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Iterator/SortableIterator.php
Expand Up @@ -73,8 +73,7 @@ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder =
} elseif (self::SORT_BY_NONE === $sort) {
$this->sort = $order;
} elseif (\is_callable($sort)) {
$this->sort = $reverseOrder ? function ($a, $b) use ($sort) { return -$sort($a, $b); }
: $sort;
$this->sort = $reverseOrder ? static function ($a, $b) use ($sort) { return -$sort($a, $b); } : $sort;
} else {
throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
}
Expand Down

0 comments on commit d489ffe

Please sign in to comment.