|
@@ 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). |
|
@@ 3057-3068 (lines=12) @@
|
| 3054 |
|
* @return static |
| 3055 |
|
* <p>Object with appended $prefix.</p> |
| 3056 |
|
*/ |
| 3057 |
|
public function prepend(string ...$prefix): self |
| 3058 |
|
{ |
| 3059 |
|
if (\count($prefix) <= 1) { |
| 3060 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 3061 |
|
$prefix = $prefix[0]; |
| 3062 |
|
} else { |
| 3063 |
|
/** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 3064 |
|
$prefix = \implode('', $prefix); |
| 3065 |
|
} |
| 3066 |
|
|
| 3067 |
|
return static::create($prefix . $this->str, $this->encoding); |
| 3068 |
|
} |
| 3069 |
|
|
| 3070 |
|
/** |
| 3071 |
|
* Returns a new string starting with $prefix. |