框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
+4 -2
View File
@@ -12,6 +12,7 @@
namespace Symfony\Component\Cache;
use Psr\Cache\CacheItemInterface;
use Psr\Clock\ClockInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
use Symfony\Component\Cache\Exception\LogicException;
@@ -34,6 +35,7 @@ final class CacheItem implements ItemInterface
protected ?CacheItemInterface $innerItem = null;
protected ?string $poolHash = null;
protected bool $isTaggable = false;
protected ?ClockInterface $clock = null;
public function getKey(): string
{
@@ -78,9 +80,9 @@ final class CacheItem implements ItemInterface
if (null === $time) {
$this->expiry = null;
} elseif ($time instanceof \DateInterval) {
$this->expiry = microtime(true) + \DateTimeImmutable::createFromFormat('U', 0)->add($time)->format('U.u');
$this->expiry = ($this->clock?->now()->format('U.u') ?? microtime(true)) + \DateTimeImmutable::createFromFormat('U', 0)->add($time)->format('U.u');
} elseif (\is_int($time)) {
$this->expiry = $time + microtime(true);
$this->expiry = $time + ($this->clock?->now()->format('U.u') ?? microtime(true));
} else {
throw new InvalidArgumentException(\sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given.', get_debug_type($time)));
}