mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
N°8910 - Upgrade Symfony packages (#811)
This commit is contained in:
8
lib/symfony/cache/Traits/ContractsTrait.php
vendored
8
lib/symfony/cache/Traits/ContractsTrait.php
vendored
@@ -54,7 +54,7 @@ trait ContractsTrait
|
||||
}
|
||||
|
||||
$previousWrapper = $this->callbackWrapper;
|
||||
$this->callbackWrapper = $callbackWrapper ?? static fn (callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger) => $callback($item, $save);
|
||||
$this->callbackWrapper = $callbackWrapper ?? static fn (callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger, ?float $beta = null) => $callback($item, $save);
|
||||
|
||||
return $previousWrapper;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ trait ContractsTrait
|
||||
private function doGet(AdapterInterface $pool, string $key, callable $callback, ?float $beta, ?array &$metadata = null): mixed
|
||||
{
|
||||
if (0 > $beta ??= 1.0) {
|
||||
throw new InvalidArgumentException(sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta));
|
||||
throw new InvalidArgumentException(\sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta));
|
||||
}
|
||||
|
||||
static $setMetadata;
|
||||
@@ -82,7 +82,7 @@ trait ContractsTrait
|
||||
|
||||
$this->callbackWrapper ??= LockRegistry::compute(...);
|
||||
|
||||
return $this->contractsGet($pool, $key, function (CacheItem $item, bool &$save) use ($pool, $callback, $setMetadata, &$metadata, $key) {
|
||||
return $this->contractsGet($pool, $key, function (CacheItem $item, bool &$save) use ($pool, $callback, $setMetadata, &$metadata, $key, $beta) {
|
||||
// don't wrap nor save recursive calls
|
||||
if (isset($this->computing[$key])) {
|
||||
$value = $callback($item, $save);
|
||||
@@ -101,7 +101,7 @@ trait ContractsTrait
|
||||
try {
|
||||
$value = ($this->callbackWrapper)($callback, $item, $save, $pool, function (CacheItem $item) use ($setMetadata, $startTime, &$metadata) {
|
||||
$setMetadata($item, $startTime, $metadata);
|
||||
}, $this->logger ?? null);
|
||||
}, $this->logger ?? null, $beta);
|
||||
$setMetadata($item, $startTime, $metadata);
|
||||
|
||||
return $value;
|
||||
|
||||
Reference in New Issue
Block a user