Code Duplication    Length = 13-13 lines in 2 locations

src/Stringy.php 2 locations

@@ 324-336 (lines=13) @@
321
     * @return static
322
     *                <p>Object with appended $suffix.</p>
323
     */
324
    public function appendStringy(...$suffix): self
325
    {
326
        $suffixStr = '';
327
        foreach ($suffix as $suffixTmp) {
328
            if ($suffixTmp instanceof CollectionStringy) {
329
                $suffixStr .= $suffixTmp->implode('');
330
            } else {
331
                $suffixStr .= $suffixTmp->toString();
332
            }
333
        }
334
335
        return static::create($this->str . $suffixStr, $this->encoding);
336
    }
337
338
    /**
339
     * Append an unique identifier.
@@ 3211-3223 (lines=13) @@
3208
     * @return static
3209
     *                <p>Object with appended $prefix.</p>
3210
     */
3211
    public function prependStringy(...$prefix): self
3212
    {
3213
        $prefixStr = '';
3214
        foreach ($prefix as $prefixTmp) {
3215
            if ($prefixTmp instanceof CollectionStringy) {
3216
                $prefixStr .= $prefixTmp->implode('');
3217
            } else {
3218
                $prefixStr .= $prefixTmp->toString();
3219
            }
3220
        }
3221
3222
        return static::create($prefixStr . $this->str, $this->encoding);
3223
    }
3224
3225
    /**
3226
     * Replaces all occurrences of $pattern in $str by $replacement.