reinstall dependencies on php 7.4

This commit is contained in:
Attila Jozsef Kerekes
2022-11-14 21:15:40 +01:00
parent 8972a11c0a
commit 98401f20a2
681 changed files with 65697 additions and 9274 deletions

View File

@@ -38,9 +38,11 @@ interface CacheInterface
* See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
* @param array &$metadata The metadata of the cached item {@see ItemInterface::getMetadata()}
*
* @return mixed
*
* @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);
/**
* Removes an item from the pool.

View File

@@ -27,8 +27,10 @@ trait CacheTrait
{
/**
* {@inheritdoc}
*
* @return mixed
*/
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)
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
@@ -41,9 +43,9 @@ 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)
{
if (0 > $beta ??= 1.0) {
if (0 > $beta = $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 { };
}
@@ -58,7 +60,7 @@ trait CacheTrait
if ($recompute = $ctime && $expiry && $expiry <= ($now = microtime(true)) - $ctime / 1000 * $beta * log(random_int(1, \PHP_INT_MAX) / \PHP_INT_MAX)) {
// force applying defaultLifetime to expiry
$item->expiresAt(null);
$logger?->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
$logger && $logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
'key' => $key,
'delta' => sprintf('%.1f', $expiry - $now),
]);

View File

@@ -26,5 +26,5 @@ interface CallbackInterface
*
* @return mixed The computed value for the passed item
*/
public function __invoke(CacheItemInterface $item, bool &$save): mixed;
public function __invoke(CacheItemInterface $item, bool &$save);
}

View File

@@ -54,7 +54,7 @@ interface ItemInterface extends CacheItemInterface
* @throws InvalidArgumentException When $tag is not valid
* @throws CacheException When the item comes from a pool that is not tag-aware
*/
public function tag(string|iterable $tags): static;
public function tag($tags): self;
/**
* Returns a list of metadata info that were saved alongside with the cached value.

View File

@@ -34,5 +34,5 @@ interface TagAwareCacheInterface extends CacheInterface
*
* @throws InvalidArgumentException When $tags is not valid
*/
public function invalidateTags(array $tags): bool;
public function invalidateTags(array $tags);
}

View File

@@ -16,8 +16,8 @@
}
],
"require": {
"php": ">=8.1",
"psr/cache": "^3.0"
"php": ">=7.2.5",
"psr/cache": "^1.0|^2.0|^3.0"
},
"suggest": {
"symfony/cache-implementation": ""
@@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.1-dev"
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",