Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4236-4249 (lines=14) @@
4233
     *
4234
     * @return bool
4235
     */
4236
    public function sizeIs(int $size): bool
4237
    {
4238
        // init
4239
        $itemsTempCount = 0;
4240
4241
        foreach ($this->getGenerator() as $key => $value) {
4242
            ++$itemsTempCount;
4243
            if ($itemsTempCount > $size) {
4244
                return false;
4245
            }
4246
        }
4247
4248
        return $itemsTempCount === $size;
4249
    }
4250
4251
    /**
4252
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4288-4301 (lines=14) @@
4285
     *
4286
     * @return bool
4287
     */
4288
    public function sizeIsGreaterThan(int $size): bool
4289
    {
4290
        // init
4291
        $itemsTempCount = 0;
4292
4293
        foreach ($this->getGenerator() as $key => $value) {
4294
            ++$itemsTempCount;
4295
            if ($itemsTempCount > $size) {
4296
                return true;
4297
            }
4298
        }
4299
4300
        return $itemsTempCount > $size;
4301
    }
4302
4303
    /**
4304
     * Checks whether array has less than $size items.
@@ 4310-4323 (lines=14) @@
4307
     *
4308
     * @return bool
4309
     */
4310
    public function sizeIsLessThan(int $size): bool
4311
    {
4312
        // init
4313
        $itemsTempCount = 0;
4314
4315
        foreach ($this->getGenerator() as $key => $value) {
4316
            ++$itemsTempCount;
4317
            if ($itemsTempCount > $size) {
4318
                return false;
4319
            }
4320
        }
4321
4322
        return $itemsTempCount < $size;
4323
    }
4324
4325
    /**
4326
     * Counts all elements in an array, or something in an object.