Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4010-4023 (lines=14) @@
4007
     *
4008
     * @return bool
4009
     */
4010
    public function sizeIs(int $size): bool
4011
    {
4012
        // init
4013
        $itemsTempCount = 0;
4014
4015
        foreach ($this->getGenerator() as $key => $value) {
4016
            ++$itemsTempCount;
4017
            if ($itemsTempCount > $size) {
4018
                return false;
4019
            }
4020
        }
4021
4022
        return $itemsTempCount === $size;
4023
    }
4024
4025
    /**
4026
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4062-4075 (lines=14) @@
4059
     *
4060
     * @return bool
4061
     */
4062
    public function sizeIsGreaterThan(int $size): bool
4063
    {
4064
        // init
4065
        $itemsTempCount = 0;
4066
4067
        foreach ($this->getGenerator() as $key => $value) {
4068
            ++$itemsTempCount;
4069
            if ($itemsTempCount > $size) {
4070
                return true;
4071
            }
4072
        }
4073
4074
        return $itemsTempCount > $size;
4075
    }
4076
4077
    /**
4078
     * Checks whether array has less than $size items.
@@ 4084-4097 (lines=14) @@
4081
     *
4082
     * @return bool
4083
     */
4084
    public function sizeIsLessThan(int $size): bool
4085
    {
4086
        // init
4087
        $itemsTempCount = 0;
4088
4089
        foreach ($this->getGenerator() as $key => $value) {
4090
            ++$itemsTempCount;
4091
            if ($itemsTempCount > $size) {
4092
                return false;
4093
            }
4094
        }
4095
4096
        return $itemsTempCount < $size;
4097
    }
4098
4099
    /**
4100
     * Counts all elements in an array, or something in an object.