reinstall dependencies on php 7.4

This commit is contained in:
Attila Jozsef Kerekes
2022-11-14 21:15:40 +01:00
parent 8972a11c0a
commit 98401f20a2
681 changed files with 65697 additions and 9274 deletions

View File

@@ -33,7 +33,7 @@ class CodePointString extends AbstractUnicodeString
$this->string = $string;
}
public function append(string ...$suffix): static
public function append(string ...$suffix): AbstractString
{
$str = clone $this;
$str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix);
@@ -80,12 +80,14 @@ class CodePointString extends AbstractUnicodeString
return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')];
}
public function endsWith(string|iterable|AbstractString $suffix): bool
public function endsWith($suffix): bool
{
if ($suffix instanceof AbstractString) {
$suffix = $suffix->string;
} elseif (!\is_string($suffix)) {
} elseif (\is_array($suffix) || $suffix instanceof \Traversable) {
return parent::endsWith($suffix);
} else {
$suffix = (string) $suffix;
}
if ('' === $suffix || !preg_match('//u', $suffix)) {
@@ -99,12 +101,14 @@ class CodePointString extends AbstractUnicodeString
return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix));
}
public function equalsTo(string|iterable|AbstractString $string): bool
public function equalsTo($string): bool
{
if ($string instanceof AbstractString) {
$string = $string->string;
} elseif (!\is_string($string)) {
} elseif (\is_array($string) || $string instanceof \Traversable) {
return parent::equalsTo($string);
} else {
$string = (string) $string;
}
if ('' !== $string && $this->ignoreCase) {
@@ -114,12 +118,14 @@ class CodePointString extends AbstractUnicodeString
return $string === $this->string;
}
public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int
public function indexOf($needle, int $offset = 0): ?int
{
if ($needle instanceof AbstractString) {
$needle = $needle->string;
} elseif (!\is_string($needle)) {
} elseif (\is_array($needle) || $needle instanceof \Traversable) {
return parent::indexOf($needle, $offset);
} else {
$needle = (string) $needle;
}
if ('' === $needle) {
@@ -131,12 +137,14 @@ class CodePointString extends AbstractUnicodeString
return false === $i ? null : $i;
}
public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int
public function indexOfLast($needle, int $offset = 0): ?int
{
if ($needle instanceof AbstractString) {
$needle = $needle->string;
} elseif (!\is_string($needle)) {
} elseif (\is_array($needle) || $needle instanceof \Traversable) {
return parent::indexOfLast($needle, $offset);
} else {
$needle = (string) $needle;
}
if ('' === $needle) {
@@ -153,7 +161,7 @@ class CodePointString extends AbstractUnicodeString
return mb_strlen($this->string, 'UTF-8');
}
public function prepend(string ...$prefix): static
public function prepend(string ...$prefix): AbstractString
{
$str = clone $this;
$str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string;
@@ -165,7 +173,7 @@ class CodePointString extends AbstractUnicodeString
return $str;
}
public function replace(string $from, string $to): static
public function replace(string $from, string $to): AbstractString
{
$str = clone $this;
@@ -186,7 +194,7 @@ class CodePointString extends AbstractUnicodeString
return $str;
}
public function slice(int $start = 0, int $length = null): static
public function slice(int $start = 0, int $length = null): AbstractString
{
$str = clone $this;
$str->string = mb_substr($this->string, $start, $length, 'UTF-8');
@@ -194,7 +202,7 @@ class CodePointString 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): AbstractString
{
if (!preg_match('//u', $replacement)) {
throw new InvalidArgumentException('Invalid UTF-8 string.');
@@ -210,7 +218,7 @@ class CodePointString extends AbstractUnicodeString
public function split(string $delimiter, int $limit = null, int $flags = null): array
{
if (1 > $limit ??= \PHP_INT_MAX) {
if (1 > $limit = $limit ?? \PHP_INT_MAX) {
throw new InvalidArgumentException('Split limit must be a positive integer.');
}
@@ -239,12 +247,14 @@ class CodePointString extends AbstractUnicodeString
return $chunks;
}
public function startsWith(string|iterable|AbstractString $prefix): bool
public function startsWith($prefix): bool
{
if ($prefix instanceof AbstractString) {
$prefix = $prefix->string;
} elseif (!\is_string($prefix)) {
} elseif (\is_array($prefix) || $prefix instanceof \Traversable) {
return parent::startsWith($prefix);
} else {
$prefix = (string) $prefix;
}
if ('' === $prefix || !preg_match('//u', $prefix)) {