Code Duplication    Length = 5-5 lines in 2 locations

src/Zicht/Itertools/lib/SortedIterator.php 2 locations

@@ 31-35 (lines=5) @@
28
    public function __construct(\Closure $func, \Iterator $iterable, $reverse = false)
29
    {
30
        if ($reverse) {
31
            $cmp = function ($a, $b) use ($func) {
32
                $orderA = $a['order'];
33
                $orderB = $b['order'];
34
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? 1 : -1);
35
            };
36
        } else {
37
            $cmp = function ($a, $b) use ($func) {
38
                $orderA = $a['order'];
@@ 37-41 (lines=5) @@
34
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? 1 : -1);
35
            };
36
        } else {
37
            $cmp = function ($a, $b) use ($func) {
38
                $orderA = $a['order'];
39
                $orderB = $b['order'];
40
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? -1 : 1);
41
            };
42
        }
43
44
        $data = [];