Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4104-4117 (lines=14) @@
4101
     *
4102
     * @return bool
4103
     */
4104
    public function sizeIs(int $size): bool
4105
    {
4106
        // init
4107
        $itemsTempCount = 0;
4108
4109
        foreach ($this->getGenerator() as $key => $value) {
4110
            ++$itemsTempCount;
4111
            if ($itemsTempCount > $size) {
4112
                return false;
4113
            }
4114
        }
4115
4116
        return $itemsTempCount === $size;
4117
    }
4118
4119
    /**
4120
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4156-4169 (lines=14) @@
4153
     *
4154
     * @return bool
4155
     */
4156
    public function sizeIsGreaterThan(int $size): bool
4157
    {
4158
        // init
4159
        $itemsTempCount = 0;
4160
4161
        foreach ($this->getGenerator() as $key => $value) {
4162
            ++$itemsTempCount;
4163
            if ($itemsTempCount > $size) {
4164
                return true;
4165
            }
4166
        }
4167
4168
        return $itemsTempCount > $size;
4169
    }
4170
4171
    /**
4172
     * Checks whether array has less than $size items.
@@ 4178-4191 (lines=14) @@
4175
     *
4176
     * @return bool
4177
     */
4178
    public function sizeIsLessThan(int $size): bool
4179
    {
4180
        // init
4181
        $itemsTempCount = 0;
4182
4183
        foreach ($this->getGenerator() as $key => $value) {
4184
            ++$itemsTempCount;
4185
            if ($itemsTempCount > $size) {
4186
                return false;
4187
            }
4188
        }
4189
4190
        return $itemsTempCount < $size;
4191
    }
4192
4193
    /**
4194
     * Counts all elements in an array, or something in an object.