Code Duplication    Length = 14-14 lines in 3 locations

src/Arrayy.php 3 locations

@@ 4639-4652 (lines=14) @@
4636
     *
4637
     * @return bool
4638
     */
4639
    public function sizeIs(int $size): bool
4640
    {
4641
        // init
4642
        $itemsTempCount = 0;
4643
4644
        foreach ($this->getGenerator() as $key => $value) {
4645
            ++$itemsTempCount;
4646
            if ($itemsTempCount > $size) {
4647
                return false;
4648
            }
4649
        }
4650
4651
        return $itemsTempCount === $size;
4652
    }
4653
4654
    /**
4655
     * Checks whether array has between $fromSize to $toSize items. $toSize can be
@@ 4691-4704 (lines=14) @@
4688
     *
4689
     * @return bool
4690
     */
4691
    public function sizeIsGreaterThan(int $size): bool
4692
    {
4693
        // init
4694
        $itemsTempCount = 0;
4695
4696
        foreach ($this->getGenerator() as $key => $value) {
4697
            ++$itemsTempCount;
4698
            if ($itemsTempCount > $size) {
4699
                return true;
4700
            }
4701
        }
4702
4703
        return $itemsTempCount > $size;
4704
    }
4705
4706
    /**
4707
     * Checks whether array has less than $size items.
@@ 4713-4726 (lines=14) @@
4710
     *
4711
     * @return bool
4712
     */
4713
    public function sizeIsLessThan(int $size): bool
4714
    {
4715
        // init
4716
        $itemsTempCount = 0;
4717
4718
        foreach ($this->getGenerator() as $key => $value) {
4719
            ++$itemsTempCount;
4720
            if ($itemsTempCount > $size) {
4721
                return false;
4722
            }
4723
        }
4724
4725
        return $itemsTempCount < $size;
4726
    }
4727
4728
    /**
4729
     * Counts all elements in an array, or something in an object.