N°8834 - Add compatibility with PHP 8.4 (#819)

* N°8834 - Add compatibility with PHP 8.4

* Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
Lenaick
2026-02-26 10:36:32 +01:00
committed by GitHub
parent d4821b7edc
commit fc967c06ce
961 changed files with 12298 additions and 7130 deletions

View File

@@ -263,7 +263,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function endsWith(string|iterable $suffix): bool
{
if (\is_string($suffix)) {
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
foreach ($suffix as $s) {
@@ -312,7 +312,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function equalsTo(string|iterable $string): bool
{
if (\is_string($string)) {
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
foreach ($string as $s) {
@@ -340,7 +340,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function indexOf(string|iterable $needle, int $offset = 0): ?int
{
if (\is_string($needle)) {
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
$i = \PHP_INT_MAX;
@@ -362,7 +362,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function indexOfLast(string|iterable $needle, int $offset = 0): ?int
{
if (\is_string($needle)) {
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
$i = null;
@@ -383,7 +383,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
return '' === $this->string;
}
abstract public function join(array $strings, string $lastGlue = null): static;
abstract public function join(array $strings, ?string $lastGlue = null): static;
public function jsonSerialize(): string
{
@@ -414,7 +414,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function repeat(int $multiplier): static
{
if (0 > $multiplier) {
throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier));
throw new InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier));
}
$str = clone $this;
@@ -429,16 +429,16 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
abstract public function reverse(): static;
abstract public function slice(int $start = 0, int $length = null): static;
abstract public function slice(int $start = 0, ?int $length = null): static;
abstract public function snake(): static;
abstract public function splice(string $replacement, int $start = 0, int $length = null): static;
abstract public function splice(string $replacement, int $start = 0, ?int $length = null): static;
/**
* @return static[]
*/
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 (null === $flags) {
throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.');
@@ -481,7 +481,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public function startsWith(string|iterable $prefix): bool
{
if (\is_string($prefix)) {
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
foreach ($prefix as $prefix) {
@@ -495,7 +495,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
abstract public function title(bool $allWords = false): static;
public function toByteString(string $toEncoding = null): ByteString
public function toByteString(?string $toEncoding = null): ByteString
{
$b = new ByteString();