Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3845-3858 (lines=14) @@
3842
     *
3843
     * @return bool
3844
     */
3845
    public function sizeIs(int $size): bool
3846
    {
3847
        // init
3848
        $itemsTempCount = 0;
3849
3850
        foreach ($this->getGenerator() as $key => $value) {
3851
            ++$itemsTempCount;
3852
            if ($itemsTempCount > $size) {
3853
                return false;
3854
            }
3855
        }
3856
3857
        return $itemsTempCount === $size;
3858
    }
3859
3860
    /**
3861
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 3897-3910 (lines=14) @@
3894
     *
3895
     * @return bool
3896
     */
3897
    public function sizeIsGreaterThan(int $size): bool
3898
    {
3899
        // init
3900
        $itemsTempCount = 0;
3901
3902
        foreach ($this->getGenerator() as $key => $value) {
3903
            ++$itemsTempCount;
3904
            if ($itemsTempCount > $size) {
3905
                return true;
3906
            }
3907
        }
3908
3909
        return $itemsTempCount > $size;
3910
    }
3911
3912
    /**
3913
     * Checks whether array has less than $size items.
@@ 3919-3932 (lines=14) @@
3916
     *
3917
     * @return bool
3918
     */
3919
    public function sizeIsLessThan(int $size): bool
3920
    {
3921
        // init
3922
        $itemsTempCount = 0;
3923
3924
        foreach ($this->getGenerator() as $key => $value) {
3925
            ++$itemsTempCount;
3926
            if ($itemsTempCount > $size) {
3927
                return false;
3928
            }
3929
        }
3930
3931
        return $itemsTempCount < $size;
3932
    }
3933
3934
    /**
3935
     * Counts all elements in an array, or something in an object.