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.
@@ 2630-2642 (lines=13) @@
2627
     * @return static
2628
     *                <p>Object with appended $prefix.</p>
2629
     */
2630
    public function prependStringy(...$prefix): self
2631
    {
2632
        $prefixStr = '';
2633
        foreach ($prefix as $prefixTmp) {
2634
            if ($prefixTmp instanceof CollectionStringy) {
2635
                $prefixStr .= $prefixTmp->implode('');
2636
            } else {
2637
                $prefixStr .= $prefixTmp->toString();
2638
            }
2639
        }
2640
2641
        return static::create($prefixStr . $this->str, $this->encoding);
2642
    }
2643
2644
    /**
2645
     * Replaces all occurrences of $pattern in $str by $replacement.