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).
@@ 1944-1955 (lines=12) @@
1941
     *
1942
     * @noinspection PhpDocSignatureInspection
1943
     */
1944
    public function prepend(string ...$prefix): self
1945
    {
1946
        if (\count($prefix) <= 1) {
1947
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
1948
            $prefix = $prefix[0];
1949
        } else {
1950
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
1951
            $prefix = \implode('', $prefix);
1952
        }
1953
1954
        return static::create($prefix . $this->str, $this->encoding);
1955
    }
1956
1957
    /**
1958
     * Replaces all occurrences of $pattern in $str by $replacement.