Code Duplication    Length = 16-16 lines in 2 locations

src/Stringy.php 2 locations

@@ 2146-2161 (lines=16) @@
2143
    {
2144
        $strUpper = $this->toUpperCase()->str;
2145
2146
        foreach ($str as $strTmp) {
2147
            /**
2148
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
2149
             */
2150
            if ($strTmp instanceof self) {
2151
                if ($strUpper !== $strTmp->toUpperCase()->str) {
2152
                    return false;
2153
                }
2154
            } elseif (\is_scalar($strTmp)) {
2155
                if ($strUpper !== $this->utf8::strtoupper((string) $strTmp, $this->encoding)) {
2156
                    return false;
2157
                }
2158
            } else {
2159
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
2160
            }
2161
        }
2162
2163
        return true;
2164
    }
@@ 2181-2196 (lines=16) @@
2178
     */
2179
    public function isEqualsCaseSensitive(...$str): bool
2180
    {
2181
        foreach ($str as $strTmp) {
2182
            /**
2183
             * @psalm-suppress RedundantConditionGivenDocblockType - wait for union-types :)
2184
             */
2185
            if ($strTmp instanceof self) {
2186
                if ($this->str !== $strTmp->str) {
2187
                    return false;
2188
                }
2189
            } elseif (\is_scalar($strTmp)) {
2190
                if ($this->str !== (string) $strTmp) {
2191
                    return false;
2192
                }
2193
            } else {
2194
                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
2195
            }
2196
        }
2197
2198
        return true;
2199
    }