Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -44,7 +44,7 @@ interface CacheInterface
*
* @throws InvalidArgumentException When $key is not valid or when $beta is negative
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed;
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed;
/**
* Removes an item from the pool.

View File

@@ -25,7 +25,7 @@ class_exists(InvalidArgumentException::class);
*/
trait CacheTrait
{
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
@@ -35,10 +35,10 @@ trait CacheTrait
return $this->deleteItem($key);
}
private function doGet(CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, array &$metadata = null, LoggerInterface $logger = null): mixed
private function doGet(CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, ?array &$metadata = null, ?LoggerInterface $logger = null): mixed
{
if (0 > $beta ??= 1.0) {
throw new class(sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta)) extends \InvalidArgumentException implements InvalidArgumentException {};
throw new class(\sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta)) extends \InvalidArgumentException implements InvalidArgumentException {};
}
$item = $pool->getItem($key);
@@ -54,7 +54,7 @@ trait CacheTrait
$item->expiresAt(null);
$logger?->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
'key' => $key,
'delta' => sprintf('%.1f', $expiry - $now),
'delta' => \sprintf('%.1f', $expiry - $now),
]);
}
}

View File

@@ -0,0 +1,31 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Contracts\Cache;
use Psr\Cache\InvalidArgumentException;
/**
* Enables namespace-based invalidation by prefixing keys with backend-native namespace separators.
*
* Note that calling `withSubNamespace()` MUST NOT mutate the pool, but return a new instance instead.
*
* When tags are used, they MUST ignore sub-namespaces.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface NamespacedPoolInterface
{
/**
* @throws InvalidArgumentException If the namespace contains characters found in ItemInterface's RESERVED_CHARACTERS
*/
public function withSubNamespace(string $namespace): static;
}

View File

@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.4-dev"
"dev-main": "3.6-dev"
},
"thanks": {
"name": "symfony/contracts",