Code Duplication    Length = 12-12 lines in 2 locations

src/Stringy.php 2 locations

@@ 258-269 (lines=12) @@
255
     * @return static
256
     *                <p>Object with appended $suffix.</p>
257
     */
258
    public function append(string ...$suffix): self
259
    {
260
        if (\count($suffix) <= 1) {
261
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
262
            $suffix = $suffix[0];
263
        } else {
264
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
265
            $suffix = \implode('', $suffix);
266
        }
267
268
        return static::create($this->str . $suffix, $this->encoding);
269
    }
270
271
    /**
272
     * Append an password (limited to chars that are good readable).
@@ 3190-3201 (lines=12) @@
3187
     * @return static
3188
     *                <p>Object with appended $prefix.</p>
3189
     */
3190
    public function prepend(string ...$prefix): self
3191
    {
3192
        if (\count($prefix) <= 1) {
3193
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
3194
            $prefix = $prefix[0];
3195
        } else {
3196
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
3197
            $prefix = \implode('', $prefix);
3198
        }
3199
3200
        return static::create($prefix . $this->str, $this->encoding);
3201
    }
3202
3203
    /**
3204
     * Returns a new string starting with $prefix.