Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3729-3742 (lines=14) @@
3726
     *
3727
     * @return bool
3728
     */
3729
    public function sizeIs(int $size): bool
3730
    {
3731
        // init
3732
        $itemsTempCount = 0;
3733
3734
        foreach ($this->getGenerator() as $key => $value) {
3735
            ++$itemsTempCount;
3736
            if ($itemsTempCount > $size) {
3737
                return false;
3738
            }
3739
        }
3740
3741
        return $itemsTempCount === $size;
3742
    }
3743
3744
    /**
3745
     * Checks whether array has less than $size items.
@@ 3751-3764 (lines=14) @@
3748
     *
3749
     * @return bool
3750
     */
3751
    public function sizeIsLessThan(int $size): bool
3752
    {
3753
        // init
3754
        $itemsTempCount = 0;
3755
3756
        foreach ($this->getGenerator() as $key => $value) {
3757
            ++$itemsTempCount;
3758
            if ($itemsTempCount > $size) {
3759
                return false;
3760
            }
3761
        }
3762
3763
        return $itemsTempCount < $size;
3764
    }
3765
3766
    /**
3767
     * Checks whether array has more than $size items.
@@ 3773-3786 (lines=14) @@
3770
     *
3771
     * @return bool
3772
     */
3773
    public function sizeIsGreaterThan(int $size): bool
3774
    {
3775
        // init
3776
        $itemsTempCount = 0;
3777
3778
        foreach ($this->getGenerator() as $key => $value) {
3779
            ++$itemsTempCount;
3780
            if ($itemsTempCount > $size) {
3781
                return true;
3782
            }
3783
        }
3784
3785
        return $itemsTempCount > $size;
3786
    }
3787
3788
    /**
3789
     * Checks whether array has between $fromSize to $toSize items. $toSize can be