Code Duplication    Length = 16-16 lines in 2 locations

src/Stringy.php 2 locations

@@ 1532-1547 (lines=16) @@
1529
    {
1530
        $strUpper = $this->toUpperCase()->str;
1531
1532
        foreach ($str as $strTmp) {
1533
            /**
1534
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1535
             */
1536
            if ($strTmp instanceof self) {
1537
                if ($strUpper !== $strTmp->toUpperCase()) {
1538
                    return false;
1539
                }
1540
            } elseif (\is_scalar($strTmp)) {
1541
                if ($strUpper !== $this->utf8::strtoupper((string) $strTmp, $this->encoding)) {
1542
                    return false;
1543
                }
1544
            } else {
1545
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1546
            }
1547
        }
1548
1549
        return true;
1550
    }
@@ 1564-1579 (lines=16) @@
1561
     */
1562
    public function isEqualsCaseSensitive(...$str): bool
1563
    {
1564
        foreach ($str as $strTmp) {
1565
            /**
1566
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
1567
             */
1568
            if ($strTmp instanceof self) {
1569
                if ($this->str !== $strTmp->str) {
1570
                    return false;
1571
                }
1572
            } elseif (\is_scalar($strTmp)) {
1573
                if ($this->str !== (string) $strTmp) {
1574
                    return false;
1575
                }
1576
            } else {
1577
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1578
            }
1579
        }
1580
1581
        return true;
1582
    }