mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°8910 - Upgrade Symfony packages (#811)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user