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

@@ 774-789 (lines=16) @@
771
 * @param mixed|null $key
772
 * @return Collection
773
 */
774
function prepend($collection, $value, $key = null)
775
{
776
    $generatorFactory = function () use ($collection, $value, $key) {
777
        if ($key === null) {
778
            yield $value;
779
        } else {
780
            yield $key => $value;
781
        }
782
783
        foreach ($collection as $key => $value) {
784
            yield $key => $value;
785
        }
786
    };
787
788
    return new Collection($generatorFactory);
789
}
790
791
/**
792
 * Returns a lazy collection of items in $collection with $value added as last element. If $key is not provided
@@ 800-815 (lines=16) @@
797
 * @param mixed|null $key
798
 * @return Collection
799
 */
800
function append($collection, $value, $key = null)
801
{
802
    $generatorFactory = function () use ($collection, $value, $key) {
803
        foreach ($collection as $k => $v) {
804
            yield $k => $v;
805
        }
806
807
        if ($key === null) {
808
            yield $value;
809
        } else {
810
            yield $key => $value;
811
        }
812
    };
813
814
    return new Collection($generatorFactory);
815
}
816
817
/**
818
 * Returns a lazy collection by removing items from $collection until first item for which $function returns false.