Code Duplication    Length = 12-12 lines in 2 locations

src/Stringy.php 2 locations

@@ 208-219 (lines=12) @@
205
     *
206
     * @noinspection PhpDocSignatureInspection
207
     */
208
    public function append(string ...$suffix): self
209
    {
210
        if (\count($suffix) <= 1) {
211
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
212
            $suffix = $suffix[0];
213
        } else {
214
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
215
            $suffix = \implode('', $suffix);
216
        }
217
218
        return static::create($this->str . $suffix, $this->encoding);
219
    }
220
221
    /**
222
     * Append an password (limited to chars that are good readable).
@@ 2310-2321 (lines=12) @@
2307
     *
2308
     * @noinspection PhpDocSignatureInspection
2309
     */
2310
    public function prepend(string ...$prefix): self
2311
    {
2312
        if (\count($prefix) <= 1) {
2313
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
2314
            $prefix = $prefix[0];
2315
        } else {
2316
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
2317
            $prefix = \implode('', $prefix);
2318
        }
2319
2320
        return static::create($prefix . $this->str, $this->encoding);
2321
    }
2322
2323
    /**
2324
     * Replaces all occurrences of $pattern in $str by $replacement.