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-13 lines in 2 locations

src/collection_functions.php 2 locations

@@ 1276-1288 (lines=13) @@
1273
 * @param array|Traversable ...$collections
1274
 * @return Collection
1275
 */
1276
function diff($collection, ...$collections)
1277
{
1278
    $valuesToCompare = toArray(values(concat(...$collections)));
1279
    $generatorFactory = function () use ($collection, $valuesToCompare) {
1280
        foreach ($collection as $key => $value) {
1281
            if (!in_array($value, $valuesToCompare)) {
1282
                yield $key => $value;
1283
            }
1284
        }
1285
    };
1286
1287
    return new Collection($generatorFactory);
1288
}
1289
1290
/**
1291
 * Returns a lazy collection of items that are in $collection and all the other arguments, indexed by the keys from the
@@ 1298-1310 (lines=13) @@
1295
 * @param array|Traversable ...$collections
1296
 * @return Collection
1297
 */
1298
function intersect($collection, ...$collections)
1299
{
1300
    $valuesToCompare = toArray(values(concat(...$collections)));
1301
    $generatorFactory = function () use ($collection, $valuesToCompare) {
1302
        foreach ($collection as $key => $value) {
1303
            if (in_array($value, $valuesToCompare)) {
1304
                yield $key => $value;
1305
            }
1306
        }
1307
    };
1308
1309
    return new Collection($generatorFactory);
1310
}
1311
1312
/**
1313
 * Returns a lazy collection where keys and values are flipped.