Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4966-4979 (lines=14) @@
4963
     *
4964
     * @return bool
4965
     */
4966
    public function sizeIs(int $size): bool
4967
    {
4968
        // init
4969
        $itemsTempCount = 0;
4970
4971
        foreach ($this->getGenerator() as $key => $value) {
4972
            ++$itemsTempCount;
4973
            if ($itemsTempCount > $size) {
4974
                return false;
4975
            }
4976
        }
4977
4978
        return $itemsTempCount === $size;
4979
    }
4980
4981
    /**
4982
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 5018-5031 (lines=14) @@
5015
     *
5016
     * @return bool
5017
     */
5018
    public function sizeIsGreaterThan(int $size): bool
5019
    {
5020
        // init
5021
        $itemsTempCount = 0;
5022
5023
        foreach ($this->getGenerator() as $key => $value) {
5024
            ++$itemsTempCount;
5025
            if ($itemsTempCount > $size) {
5026
                return true;
5027
            }
5028
        }
5029
5030
        return $itemsTempCount > $size;
5031
    }
5032
5033
    /**
5034
     * Checks whether array has less than $size items.
@@ 5040-5053 (lines=14) @@
5037
     *
5038
     * @return bool
5039
     */
5040
    public function sizeIsLessThan(int $size): bool
5041
    {
5042
        // init
5043
        $itemsTempCount = 0;
5044
5045
        foreach ($this->getGenerator() as $key => $value) {
5046
            ++$itemsTempCount;
5047
            if ($itemsTempCount > $size) {
5048
                return false;
5049
            }
5050
        }
5051
5052
        return $itemsTempCount < $size;
5053
    }
5054
5055
    /**
5056
     * Counts all elements in an array, or something in an object.