GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 13-14 lines in 2 locations

src/collection_functions.php 2 locations

@@ 399-411 (lines=13) @@
396
 * @param callable $function ($value, $key)
397
 * @return Collection
398
 */
399
function groupBy($collection, callable $function)
400
{
401
    $result = [];
402
403
    foreach ($collection as $key => $value) {
404
        $newKey = $function($value, $key);
405
406
        $group = isset($result[$newKey]) ? $result[$newKey] : new Collection([]);
407
        $result[$newKey] = $group->append($value);
408
    }
409
410
    return Collection::from($result);
411
}
412
413
/**
414
 * Returns a non-lazy collection of items grouped by the value at given key.
@@ 420-433 (lines=14) @@
417
 * @param mixed $key
418
 * @return Collection
419
 */
420
function groupByKey($collection, $groupKey)
421
{
422
    $result = [];
423
    $function = getCallable($groupKey);
424
425
    foreach ($collection as $key => $value) {
426
        $newKey = $function($value, $key);
427
428
        $group = isset($result[$newKey]) ? $result[$newKey] : new Collection([]);
429
        $result[$newKey] = $group->append($value);
430
    }
431
432
    return Collection::from($result);
433
}
434
435
/**
436
 * Executes $function for each item in $collection