Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3720-3733 (lines=14) @@
3717
     *
3718
     * @return bool
3719
     */
3720
    public function sizeIs(int $size): bool
3721
    {
3722
        // init
3723
        $itemsTempCount = 0;
3724
3725
        foreach ($this->getGenerator() as $key => $value) {
3726
            ++$itemsTempCount;
3727
            if ($itemsTempCount > $size) {
3728
                return false;
3729
            }
3730
        }
3731
3732
        return $itemsTempCount === $size;
3733
    }
3734
3735
    /**
3736
     * Checks whether array has less than $size items.
@@ 3742-3755 (lines=14) @@
3739
     *
3740
     * @return bool
3741
     */
3742
    public function sizeIsLessThan(int $size): bool
3743
    {
3744
        // init
3745
        $itemsTempCount = 0;
3746
3747
        foreach ($this->getGenerator() as $key => $value) {
3748
            ++$itemsTempCount;
3749
            if ($itemsTempCount > $size) {
3750
                return false;
3751
            }
3752
        }
3753
3754
        return $itemsTempCount < $size;
3755
    }
3756
3757
    /**
3758
     * Checks whether array has more than $size items.
@@ 3764-3777 (lines=14) @@
3761
     *
3762
     * @return bool
3763
     */
3764
    public function sizeIsGreaterThan(int $size): bool
3765
    {
3766
        // init
3767
        $itemsTempCount = 0;
3768
3769
        foreach ($this->getGenerator() as $key => $value) {
3770
            ++$itemsTempCount;
3771
            if ($itemsTempCount > $size) {
3772
                return true;
3773
            }
3774
        }
3775
3776
        return $itemsTempCount > $size;
3777
    }
3778
3779
    /**
3780
     * Checks whether array has between $fromSize to $toSize items. $toSize can be