Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4092-4105 (lines=14) @@
4089
     *
4090
     * @return bool
4091
     */
4092
    public function sizeIs(int $size): bool
4093
    {
4094
        // init
4095
        $itemsTempCount = 0;
4096
4097
        foreach ($this->getGenerator() as $key => $value) {
4098
            ++$itemsTempCount;
4099
            if ($itemsTempCount > $size) {
4100
                return false;
4101
            }
4102
        }
4103
4104
        return $itemsTempCount === $size;
4105
    }
4106
4107
    /**
4108
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4144-4157 (lines=14) @@
4141
     *
4142
     * @return bool
4143
     */
4144
    public function sizeIsGreaterThan(int $size): bool
4145
    {
4146
        // init
4147
        $itemsTempCount = 0;
4148
4149
        foreach ($this->getGenerator() as $key => $value) {
4150
            ++$itemsTempCount;
4151
            if ($itemsTempCount > $size) {
4152
                return true;
4153
            }
4154
        }
4155
4156
        return $itemsTempCount > $size;
4157
    }
4158
4159
    /**
4160
     * Checks whether array has less than $size items.
@@ 4166-4179 (lines=14) @@
4163
     *
4164
     * @return bool
4165
     */
4166
    public function sizeIsLessThan(int $size): bool
4167
    {
4168
        // init
4169
        $itemsTempCount = 0;
4170
4171
        foreach ($this->getGenerator() as $key => $value) {
4172
            ++$itemsTempCount;
4173
            if ($itemsTempCount > $size) {
4174
                return false;
4175
            }
4176
        }
4177
4178
        return $itemsTempCount < $size;
4179
    }
4180
4181
    /**
4182
     * Counts all elements in an array, or something in an object.