Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 23-27 (lines=5) @@
20
    public function __construct(\Closure $func, \Iterator $iterable, $reverse = false)
21
    {
22
        if ($reverse) {
23
            $cmp = function ($a, $b) use ($func) {
24
                $orderA = $a['order'];
25
                $orderB = $b['order'];
26
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? 1 : -1);
27
            };
28
        } else {
29
            $cmp = function ($a, $b) use ($func) {
30
                $orderA = $a['order'];
@@ 29-33 (lines=5) @@
26
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? 1 : -1);
27
            };
28
        } else {
29
            $cmp = function ($a, $b) use ($func) {
30
                $orderA = $a['order'];
31
                $orderB = $b['order'];
32
                return $orderA == $orderB ? 0 : ($orderA < $orderB ? -1 : 1);
33
            };
34
        }
35
36
        $data = [];