Code Duplication    Length = 16-16 lines in 2 locations

src/Stringy.php 2 locations

@@ 1648-1663 (lines=16) @@
1645
    {
1646
        $strUpper = $this->toUpperCase()->str;
1647
1648
        foreach ($str as $strTmp) {
1649
            /**
1650
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1651
             */
1652
            if ($strTmp instanceof self) {
1653
                if ($strUpper !== $strTmp->toUpperCase()) {
1654
                    return false;
1655
                }
1656
            } elseif (\is_scalar($strTmp)) {
1657
                if ($strUpper !== $this->utf8::strtoupper((string) $strTmp, $this->encoding)) {
1658
                    return false;
1659
                }
1660
            } else {
1661
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1662
            }
1663
        }
1664
1665
        return true;
1666
    }
@@ 1680-1695 (lines=16) @@
1677
     */
1678
    public function isEqualsCaseSensitive(...$str): bool
1679
    {
1680
        foreach ($str as $strTmp) {
1681
            /**
1682
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1683
             */
1684
            if ($strTmp instanceof self) {
1685
                if ($this->str !== $strTmp->str) {
1686
                    return false;
1687
                }
1688
            } elseif (\is_scalar($strTmp)) {
1689
                if ($this->str !== (string) $strTmp) {
1690
                    return false;
1691
                }
1692
            } else {
1693
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1694
            }
1695
        }
1696
1697
        return true;
1698
    }