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.
@@ 2641-2653 (lines=13) @@
2638
     * @return static
2639
     *                <p>Object with appended $prefix.</p>
2640
     */
2641
    public function prependStringy(...$prefix): self
2642
    {
2643
        $prefixStr = '';
2644
        foreach ($prefix as $prefixTmp) {
2645
            if ($prefixTmp instanceof CollectionStringy) {
2646
                $prefixStr .= $prefixTmp->implode('');
2647
            } else {
2648
                $prefixStr .= $prefixTmp->toString();
2649
            }
2650
        }
2651
2652
        return static::create($prefixStr . $this->str, $this->encoding);
2653
    }
2654
2655
    /**
2656
     * Replaces all occurrences of $pattern in $str by $replacement.