Code Duplication    Length = 16-16 lines in 2 locations

src/Stringy.php 2 locations

@@ 1801-1816 (lines=16) @@
1798
    {
1799
        $strUpper = $this->toUpperCase()->str;
1800
1801
        foreach ($str as $strTmp) {
1802
            /**
1803
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1804
             */
1805
            if ($strTmp instanceof self) {
1806
                if ($strUpper !== $strTmp->toUpperCase()->str) {
1807
                    return false;
1808
                }
1809
            } elseif (\is_scalar($strTmp)) {
1810
                if ($strUpper !== $this->utf8::strtoupper((string) $strTmp, $this->encoding)) {
1811
                    return false;
1812
                }
1813
            } else {
1814
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1815
            }
1816
        }
1817
1818
        return true;
1819
    }
@@ 1833-1848 (lines=16) @@
1830
     */
1831
    public function isEqualsCaseSensitive(...$str): bool
1832
    {
1833
        foreach ($str as $strTmp) {
1834
            /**
1835
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1836
             */
1837
            if ($strTmp instanceof self) {
1838
                if ($this->str !== $strTmp->str) {
1839
                    return false;
1840
                }
1841
            } elseif (\is_scalar($strTmp)) {
1842
                if ($this->str !== (string) $strTmp) {
1843
                    return false;
1844
                }
1845
            } else {
1846
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1847
            }
1848
        }
1849
1850
        return true;
1851
    }