Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 3915-3928 (lines=14) @@
3912
     *
3913
     * @return bool
3914
     */
3915
    public function sizeIs(int $size): bool
3916
    {
3917
        // init
3918
        $itemsTempCount = 0;
3919
3920
        foreach ($this->getGenerator() as $key => $value) {
3921
            ++$itemsTempCount;
3922
            if ($itemsTempCount > $size) {
3923
                return false;
3924
            }
3925
        }
3926
3927
        return $itemsTempCount === $size;
3928
    }
3929
3930
    /**
3931
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 3967-3980 (lines=14) @@
3964
     *
3965
     * @return bool
3966
     */
3967
    public function sizeIsGreaterThan(int $size): bool
3968
    {
3969
        // init
3970
        $itemsTempCount = 0;
3971
3972
        foreach ($this->getGenerator() as $key => $value) {
3973
            ++$itemsTempCount;
3974
            if ($itemsTempCount > $size) {
3975
                return true;
3976
            }
3977
        }
3978
3979
        return $itemsTempCount > $size;
3980
    }
3981
3982
    /**
3983
     * Checks whether array has less than $size items.
@@ 3989-4002 (lines=14) @@
3986
     *
3987
     * @return bool
3988
     */
3989
    public function sizeIsLessThan(int $size): bool
3990
    {
3991
        // init
3992
        $itemsTempCount = 0;
3993
3994
        foreach ($this->getGenerator() as $key => $value) {
3995
            ++$itemsTempCount;
3996
            if ($itemsTempCount > $size) {
3997
                return false;
3998
            }
3999
        }
4000
4001
        return $itemsTempCount < $size;
4002
    }
4003
4004
    /**
4005
     * Counts all elements in an array, or something in an object.