|
@@ 231-242 (lines=12) @@
|
| 228 |
|
* @return static |
| 229 |
|
* <p>Object with appended $suffix.</p> |
| 230 |
|
*/ |
| 231 |
|
public function append(string ...$suffix): self |
| 232 |
|
{ |
| 233 |
|
if (\count($suffix) <= 1) { |
| 234 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 235 |
|
$suffix = $suffix[0]; |
| 236 |
|
} else { |
| 237 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 238 |
|
$suffix = \implode('', $suffix); |
| 239 |
|
} |
| 240 |
|
|
| 241 |
|
return static::create($this->str . $suffix, $this->encoding); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
/** |
| 245 |
|
* Append an password (limited to chars that are good readable). |
|
@@ 2635-2646 (lines=12) @@
|
| 2632 |
|
* @return static |
| 2633 |
|
* <p>Object with appended $prefix.</p> |
| 2634 |
|
*/ |
| 2635 |
|
public function prepend(string ...$prefix): self |
| 2636 |
|
{ |
| 2637 |
|
if (\count($prefix) <= 1) { |
| 2638 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 2639 |
|
$prefix = $prefix[0]; |
| 2640 |
|
} else { |
| 2641 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 2642 |
|
$prefix = \implode('', $prefix); |
| 2643 |
|
} |
| 2644 |
|
|
| 2645 |
|
return static::create($prefix . $this->str, $this->encoding); |
| 2646 |
|
} |
| 2647 |
|
|
| 2648 |
|
/** |
| 2649 |
|
* Returns a new string starting with $prefix. |