Code Duplication    Length = 13-13 lines in 2 locations

src/Stringy.php 2 locations

@@ 290-302 (lines=13) @@
287
     * @return static
288
     *                <p>Object with appended $suffix.</p>
289
     */
290
    public function appendStringy(...$suffix): self
291
    {
292
        $suffixStr = '';
293
        foreach ($suffix as $suffixTmp) {
294
            if ($suffixTmp instanceof CollectionStringy) {
295
                $suffixStr .= $suffixTmp->implode('');
296
            } else {
297
                $suffixStr .= $suffixTmp->toString();
298
            }
299
        }
300
301
        return static::create($this->str . $suffixStr, $this->encoding);
302
    }
303
304
    /**
305
     * Append an unique identifier.
@@ 2640-2652 (lines=13) @@
2637
     * @return static
2638
     *                <p>Object with appended $prefix.</p>
2639
     */
2640
    public function prependStringy(...$prefix): self
2641
    {
2642
        $prefixStr = '';
2643
        foreach ($prefix as $prefixTmp) {
2644
            if ($prefixTmp instanceof CollectionStringy) {
2645
                $prefixStr .= $prefixTmp->implode('');
2646
            } else {
2647
                $prefixStr .= $prefixTmp->toString();
2648
            }
2649
        }
2650
2651
        return static::create($prefixStr . $this->str, $this->encoding);
2652
    }
2653
2654
    /**
2655
     * Replaces all occurrences of $pattern in $str by $replacement.