mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-11 17:33:56 +09:00
Update dependencies
This commit is contained in:
@@ -39,9 +39,9 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_PHP,
|
||||
];
|
||||
|
||||
private $marshaller;
|
||||
private $client;
|
||||
private $lazyClient;
|
||||
private MarshallerInterface $marshaller;
|
||||
private \Memcached $client;
|
||||
private \Memcached $lazyClient;
|
||||
|
||||
/**
|
||||
* Using a MemcachedAdapter with a TagAwareAdapter for storing tags is discouraged.
|
||||
@@ -90,11 +90,9 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
*
|
||||
* @param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs
|
||||
*
|
||||
* @return \Memcached
|
||||
*
|
||||
* @throws \ErrorException When invalid options or servers are provided
|
||||
*/
|
||||
public static function createConnection($servers, array $options = [])
|
||||
public static function createConnection(array|string $servers, array $options = []): \Memcached
|
||||
{
|
||||
if (\is_string($servers)) {
|
||||
$servers = [$servers];
|
||||
@@ -242,7 +240,7 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doSave(array $values, int $lifetime)
|
||||
protected function doSave(array $values, int $lifetime): array|bool
|
||||
{
|
||||
if (!$values = $this->marshaller->marshall($values, $failed)) {
|
||||
return $failed;
|
||||
@@ -263,7 +261,7 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doFetch(array $ids)
|
||||
protected function doFetch(array $ids): iterable
|
||||
{
|
||||
try {
|
||||
$encodedIds = array_map([__CLASS__, 'encodeKey'], $ids);
|
||||
@@ -284,7 +282,7 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doHave(string $id)
|
||||
protected function doHave(string $id): bool
|
||||
{
|
||||
return false !== $this->getClient()->get(self::encodeKey($id)) || $this->checkResultCode(\Memcached::RES_SUCCESS === $this->client->getResultCode());
|
||||
}
|
||||
@@ -292,7 +290,7 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doDelete(array $ids)
|
||||
protected function doDelete(array $ids): bool
|
||||
{
|
||||
$ok = true;
|
||||
$encodedIds = array_map([__CLASS__, 'encodeKey'], $ids);
|
||||
@@ -308,12 +306,12 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doClear(string $namespace)
|
||||
protected function doClear(string $namespace): bool
|
||||
{
|
||||
return '' === $namespace && $this->getClient()->flush();
|
||||
}
|
||||
|
||||
private function checkResultCode($result)
|
||||
private function checkResultCode(mixed $result)
|
||||
{
|
||||
$code = $this->client->getResultCode();
|
||||
|
||||
@@ -326,7 +324,7 @@ class MemcachedAdapter extends AbstractAdapter
|
||||
|
||||
private function getClient(): \Memcached
|
||||
{
|
||||
if ($this->client) {
|
||||
if (isset($this->client)) {
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user