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

src/collection_functions.php 2 locations

@@ 785-800 (lines=16) @@
782
 * @param mixed|null $key
783
 * @return Collection
784
 */
785
function prepend($collection, $value, $key = null)
786
{
787
    $generatorFactory = function () use ($collection, $value, $key) {
788
        if ($key === null) {
789
            yield $value;
790
        } else {
791
            yield $key => $value;
792
        }
793
794
        foreach ($collection as $key => $value) {
795
            yield $key => $value;
796
        }
797
    };
798
799
    return new Collection($generatorFactory);
800
}
801
802
/**
803
 * Returns a lazy collection of items in $collection with $value added as last element. If $key is not provided
@@ 811-826 (lines=16) @@
808
 * @param mixed|null $key
809
 * @return Collection
810
 */
811
function append($collection, $value, $key = null)
812
{
813
    $generatorFactory = function () use ($collection, $value, $key) {
814
        foreach ($collection as $k => $v) {
815
            yield $k => $v;
816
        }
817
818
        if ($key === null) {
819
            yield $value;
820
        } else {
821
            yield $key => $value;
822
        }
823
    };
824
825
    return new Collection($generatorFactory);
826
}
827
828
/**
829
 * Returns a lazy collection by removing items from $collection until first item for which $function returns false.