N°8910 - Upgrade Symfony packages

This commit is contained in:
Benjamin DALSASS
2026-02-19 10:00:56 +01:00
parent 0f11fd9919
commit 5d3ad83946
224 changed files with 4758 additions and 1778 deletions

View File

@@ -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;