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

@@ -53,7 +53,7 @@ class GlobResource implements \IteratorAggregate, SelfCheckingResourceInterface
$this->globBrace = \defined('GLOB_BRACE') ? \GLOB_BRACE : 0;
if (false === $resolvedPrefix) {
throw new \InvalidArgumentException(sprintf('The path "%s" does not exist.', $prefix));
throw new \InvalidArgumentException(\sprintf('The path "%s" does not exist.', $prefix));
}
$this->prefix = $resolvedPrefix;
@@ -77,21 +77,28 @@ class GlobResource implements \IteratorAggregate, SelfCheckingResourceInterface
return $this->hash === $hash;
}
/**
* @internal
*/
public function __sleep(): array
public function __serialize(): array
{
$this->hash ??= $this->computeHash();
return ['prefix', 'pattern', 'recursive', 'hash', 'forExclusion', 'excludedPrefixes'];
return [
'prefix' => $this->prefix,
'pattern' => $this->pattern,
'recursive' => $this->recursive,
'hash' => $this->hash,
'forExclusion' => $this->forExclusion,
'excludedPrefixes' => $this->excludedPrefixes,
];
}
/**
* @internal
*/
public function __wakeup(): void
public function __unserialize(array $data): void
{
$this->prefix = array_shift($data);
$this->pattern = array_shift($data);
$this->recursive = array_shift($data);
$this->hash = array_shift($data);
$this->forExclusion = array_shift($data);
$this->excludedPrefixes = array_shift($data);
$this->globBrace = \defined('GLOB_BRACE') ? \GLOB_BRACE : 0;
}
@@ -111,7 +118,7 @@ class GlobResource implements \IteratorAggregate, SelfCheckingResourceInterface
if (class_exists(Finder::class)) {
$regex = Glob::toRegex($pattern);
if ($this->recursive) {
$regex = substr_replace($regex, '(/|$)', -2, 1);
$regex = substr_replace($regex, str_ends_with($pattern, '/') ? '' : '(/|$)', -2, 1);
}
} else {
$regex = null;