Code Duplication    Length = 13-13 lines in 2 locations

src/Stringy.php 2 locations

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