🔧
This commit is contained in:
10
vendor/symfony/string/UnicodeString.php
vendored
10
vendor/symfony/string/UnicodeString.php
vendored
@@ -185,7 +185,7 @@ class UnicodeString extends AbstractUnicodeString
|
||||
return false === $i ? null : $i;
|
||||
}
|
||||
|
||||
public function join(array $strings, string $lastGlue = null): static
|
||||
public function join(array $strings, ?string $lastGlue = null): static
|
||||
{
|
||||
$str = parent::join($strings, $lastGlue);
|
||||
normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string);
|
||||
@@ -272,7 +272,7 @@ class UnicodeString extends AbstractUnicodeString
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function slice(int $start = 0, int $length = null): static
|
||||
public function slice(int $start = 0, ?int $length = null): static
|
||||
{
|
||||
$str = clone $this;
|
||||
|
||||
@@ -281,12 +281,12 @@ class UnicodeString extends AbstractUnicodeString
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function splice(string $replacement, int $start = 0, int $length = null): static
|
||||
public function splice(string $replacement, int $start = 0, ?int $length = null): static
|
||||
{
|
||||
$str = clone $this;
|
||||
|
||||
$start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0;
|
||||
$length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length;
|
||||
$length = $length ? \strlen(grapheme_substr($this->string, $start, $length)) : $length;
|
||||
$str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647);
|
||||
|
||||
if (normalizer_is_normalized($str->string)) {
|
||||
@@ -302,7 +302,7 @@ class UnicodeString extends AbstractUnicodeString
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function split(string $delimiter, int $limit = null, int $flags = null): array
|
||||
public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array
|
||||
{
|
||||
if (1 > $limit ??= 2147483647) {
|
||||
throw new InvalidArgumentException('Split limit must be a positive integer.');
|
||||
|
||||
Reference in New Issue
Block a user