Update dependencies

This commit is contained in:
Chris Hunt
2022-11-14 19:35:16 +00:00
parent 0966639699
commit ee77d09c58
677 changed files with 9253 additions and 65635 deletions

View File

@@ -26,21 +26,21 @@ trait AbstractAdapterTrait
use LoggerAwareTrait;
/**
* @var \Closure needs to be set by class, signature is function(string <key>, mixed <value>, bool <isHit>)
* needs to be set by class, signature is function(string <key>, mixed <value>, bool <isHit>).
*/
private static $createCacheItem;
private static \Closure $createCacheItem;
/**
* @var \Closure needs to be set by class, signature is function(array <deferred>, string <namespace>, array <&expiredIds>)
* needs to be set by class, signature is function(array <deferred>, string <namespace>, array <&expiredIds>).
*/
private static $mergeByLifetime;
private static \Closure $mergeByLifetime;
private $namespace = '';
private $defaultLifetime;
private $namespaceVersion = '';
private $versioningIsEnabled = false;
private $deferred = [];
private $ids = [];
private string $namespace = '';
private int $defaultLifetime;
private string $namespaceVersion = '';
private bool $versioningIsEnabled = false;
private array $deferred = [];
private array $ids = [];
/**
* @var int|null The maximum length to enforce for identifiers or null when no limit applies
@@ -54,34 +54,28 @@ trait AbstractAdapterTrait
*
* @return array|\Traversable
*/
abstract protected function doFetch(array $ids);
abstract protected function doFetch(array $ids): iterable;
/**
* Confirms if the cache contains specified cache item.
*
* @param string $id The identifier for which to check existence
*
* @return bool
*/
abstract protected function doHave(string $id);
abstract protected function doHave(string $id): bool;
/**
* Deletes all items in the pool.
*
* @param string $namespace The prefix used for all identifiers managed by this pool
*
* @return bool
*/
abstract protected function doClear(string $namespace);
abstract protected function doClear(string $namespace): bool;
/**
* Removes multiple items from the pool.
*
* @param array $ids An array of identifiers that should be removed from the pool
*
* @return bool
*/
abstract protected function doDelete(array $ids);
abstract protected function doDelete(array $ids): bool;
/**
* Persists several cache items immediately.
@@ -91,14 +85,12 @@ trait AbstractAdapterTrait
*
* @return array|bool The identifiers that failed to be cached or a boolean stating if caching succeeded or not
*/
abstract protected function doSave(array $values, int $lifetime);
abstract protected function doSave(array $values, int $lifetime): array|bool;
/**
* {@inheritdoc}
*
* @return bool
*/
public function hasItem($key)
public function hasItem(mixed $key): bool
{
$id = $this->getId($key);
@@ -117,10 +109,8 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*
* @return bool
*/
public function clear(string $prefix = '')
public function clear(string $prefix = ''): bool
{
$this->deferred = [];
if ($cleared = $this->versioningIsEnabled) {
@@ -158,20 +148,16 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*
* @return bool
*/
public function deleteItem($key)
public function deleteItem(mixed $key): bool
{
return $this->deleteItems([$key]);
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function deleteItems(array $keys)
public function deleteItems(array $keys): bool
{
$ids = [];
@@ -184,7 +170,7 @@ trait AbstractAdapterTrait
if ($this->doDelete($ids)) {
return true;
}
} catch (\Exception $e) {
} catch (\Exception) {
}
$ok = true;
@@ -209,7 +195,7 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*/
public function getItem($key)
public function getItem(mixed $key): CacheItem
{
$id = $this->getId($key);
@@ -236,7 +222,7 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*/
public function getItems(array $keys = [])
public function getItems(array $keys = []): iterable
{
$ids = [];
$commit = false;
@@ -263,10 +249,8 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*
* @return bool
*/
public function save(CacheItemInterface $item)
public function save(CacheItemInterface $item): bool
{
if (!$item instanceof CacheItem) {
return false;
@@ -278,10 +262,8 @@ trait AbstractAdapterTrait
/**
* {@inheritdoc}
*
* @return bool
*/
public function saveDeferred(CacheItemInterface $item)
public function saveDeferred(CacheItemInterface $item): bool
{
if (!$item instanceof CacheItem) {
return false;
@@ -301,7 +283,7 @@ trait AbstractAdapterTrait
*
* @return bool the previous state of versioning
*/
public function enableVersioning(bool $enable = true)
public function enableVersioning(bool $enable = true): bool
{
$wasEnabled = $this->versioningIsEnabled;
$this->versioningIsEnabled = $enable;
@@ -323,10 +305,7 @@ trait AbstractAdapterTrait
$this->ids = [];
}
/**
* @return array
*/
public function __sleep()
public function __sleep(): array
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
@@ -365,7 +344,7 @@ trait AbstractAdapterTrait
}
}
private function getId($key)
private function getId(mixed $key)
{
if ($this->versioningIsEnabled && '' === $this->namespaceVersion) {
$this->ids = [];