Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4034-4047 (lines=14) @@
4031
     *
4032
     * @return bool
4033
     */
4034
    public function sizeIs(int $size): bool
4035
    {
4036
        // init
4037
        $itemsTempCount = 0;
4038
4039
        foreach ($this->getGenerator() as $key => $value) {
4040
            ++$itemsTempCount;
4041
            if ($itemsTempCount > $size) {
4042
                return false;
4043
            }
4044
        }
4045
4046
        return $itemsTempCount === $size;
4047
    }
4048
4049
    /**
4050
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4086-4099 (lines=14) @@
4083
     *
4084
     * @return bool
4085
     */
4086
    public function sizeIsGreaterThan(int $size): bool
4087
    {
4088
        // init
4089
        $itemsTempCount = 0;
4090
4091
        foreach ($this->getGenerator() as $key => $value) {
4092
            ++$itemsTempCount;
4093
            if ($itemsTempCount > $size) {
4094
                return true;
4095
            }
4096
        }
4097
4098
        return $itemsTempCount > $size;
4099
    }
4100
4101
    /**
4102
     * Checks whether array has less than $size items.
@@ 4108-4121 (lines=14) @@
4105
     *
4106
     * @return bool
4107
     */
4108
    public function sizeIsLessThan(int $size): bool
4109
    {
4110
        // init
4111
        $itemsTempCount = 0;
4112
4113
        foreach ($this->getGenerator() as $key => $value) {
4114
            ++$itemsTempCount;
4115
            if ($itemsTempCount > $size) {
4116
                return false;
4117
            }
4118
        }
4119
4120
        return $itemsTempCount < $size;
4121
    }
4122
4123
    /**
4124
     * Counts all elements in an array, or something in an object.