Code Duplication    Length = 16-16 lines in 2 locations

src/Stringy.php 2 locations

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