update patch 1
This commit is contained in:
Vendored
+3
-3
@@ -46,7 +46,7 @@ class ByteString extends AbstractString
|
||||
public static function fromRandom(int $length = 16, ?string $alphabet = null): self
|
||||
{
|
||||
if ($length <= 0) {
|
||||
throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length));
|
||||
throw new InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length));
|
||||
}
|
||||
|
||||
$alphabet ??= self::ALPHABET_ALPHANUMERIC;
|
||||
@@ -340,7 +340,7 @@ class ByteString extends AbstractString
|
||||
public function slice(int $start = 0, ?int $length = null): static
|
||||
{
|
||||
$str = clone $this;
|
||||
$str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX);
|
||||
$str->string = substr($this->string, $start, $length ?? \PHP_INT_MAX);
|
||||
|
||||
return $str;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ class ByteString extends AbstractString
|
||||
}
|
||||
|
||||
if (!$validEncoding) {
|
||||
throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252'));
|
||||
throw new InvalidArgumentException(\sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252'));
|
||||
}
|
||||
|
||||
$u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252');
|
||||
|
||||
Reference in New Issue
Block a user