mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-03 07:28:57 +02:00
N°8910 - Upgrade Symfony packages (#811)
This commit is contained in:
@@ -101,23 +101,23 @@ class ClassExistenceResource implements SelfCheckingResourceInterface
|
||||
return $this->exists[0] xor !$exists[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __sleep(): array
|
||||
public function __serialize(): array
|
||||
{
|
||||
if (null === $this->exists) {
|
||||
$this->isFresh(0);
|
||||
}
|
||||
|
||||
return ['resource', 'exists'];
|
||||
return [
|
||||
'resource' => $this->resource,
|
||||
'exists' => $this->exists,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __wakeup(): void
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
$this->resource = array_shift($data);
|
||||
$this->exists = array_shift($data);
|
||||
|
||||
if (\is_bool($this->exists)) {
|
||||
$this->exists = [$this->exists, null];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -60,17 +60,19 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
return 'reflection.'.$this->className;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __sleep(): array
|
||||
public function __serialize(): array
|
||||
{
|
||||
if (!isset($this->hash)) {
|
||||
$this->hash = $this->computeHash();
|
||||
$this->loadFiles($this->classReflector);
|
||||
}
|
||||
|
||||
return ['files', 'className', 'hash'];
|
||||
return [
|
||||
'files' => $this->files,
|
||||
'className' => $this->className,
|
||||
'excludedVendors' => $this->excludedVendors,
|
||||
'hash' => $this->hash,
|
||||
];
|
||||
}
|
||||
|
||||
private function loadFiles(\ReflectionClass $class): void
|
||||
|
||||
Reference in New Issue
Block a user