Code Duplication    Length = 8-8 lines in 2 locations

src/Suricate/Collection.php 2 locations

@@ 273-280 (lines=8) @@
270
    public function sortBy($field, $reverse = false)
271
    {
272
        if ($reverse) {
273
            $sortFunction = function($a, $b) use ($field) {
274
                $first = dataGet($a, $field);
275
                $second = dataGet($b, $field);
276
                if ($first == $second) {
277
                    return 0;
278
                }
279
                return ($first > $second) ? -1 : 1;
280
            };
281
        } else {
282
            $sortFunction = function($a, $b) use($field) {
283
                $first = dataGet($a, $field);
@@ 282-289 (lines=8) @@
279
                return ($first > $second) ? -1 : 1;
280
            };
281
        } else {
282
            $sortFunction = function($a, $b) use($field) {
283
                $first = dataGet($a, $field);
284
                $second = dataGet($b, $field);
285
                if ($first == $second) {
286
                    return 0;
287
                }
288
                return ($first < $second) ? -1 : 1;
289
            };
290
        }
291
292