function UnicodeString::prepend
Overrides AbstractString::prepend
File
-
vendor/
symfony/ string/ UnicodeString.php, line 217
Class
- UnicodeString
- Represents a string of Unicode grapheme clusters encoded as UTF-8.
Namespace
Symfony\Component\StringCode
public function prepend(string ...$prefix) : static {
$str = clone $this;
$str->string = (1 >= \count($prefix) ? $prefix[0] ?? '' : implode('', $prefix)) . $this->string;
if (normalizer_is_normalized($str->string)) {
return $str;
}
if (false === ($string = normalizer_normalize($str->string))) {
throw new InvalidArgumentException('Invalid UTF-8 string.');
}
$str->string = $string;
return $str;
}