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

@@ -29,8 +29,9 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
{
private const MAX_KEY_LENGTH = 250;
private Collection $connection;
private MarshallerInterface $marshaller;
/** @var Collection */
private $connection;
private $marshaller;
public function __construct(Collection $connection, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
{
@@ -47,10 +48,17 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
$this->marshaller = $marshaller ?? new DefaultMarshaller();
}
public static function createConnection(array|string $dsn, array $options = []): Bucket|Collection
/**
* @param array|string $dsn
*
* @return Bucket|Collection
*/
public static function createConnection($dsn, array $options = [])
{
if (\is_string($dsn)) {
$dsn = [$dsn];
} elseif (!\is_array($dsn)) {
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be array or string, "%s" given.', __METHOD__, get_debug_type($dsn)));
}
if (!static::isSupported()) {
@@ -70,7 +78,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
$password = $options['password'] ?? '';
foreach ($dsn as $server) {
if (!str_starts_with($server, 'couchbase:')) {
if (0 !== strpos($server, 'couchbase:')) {
throw new InvalidArgumentException(sprintf('Invalid Couchbase DSN: "%s" does not start with "couchbase:".', $server));
}
@@ -140,7 +148,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
foreach ($ids as $id) {
try {
$resultCouchbase = $this->connection->get($id);
} catch (DocumentNotFoundException) {
} catch (DocumentNotFoundException $exception) {
continue;
}
@@ -181,7 +189,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
if (null === $result->mutationToken()) {
$idsErrors[] = $id;
}
} catch (DocumentNotFoundException) {
} catch (DocumentNotFoundException $exception) {
}
}
@@ -191,7 +199,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime): array|bool
protected function doSave(array $values, $lifetime)
{
if (!$values = $this->marshaller->marshall($values, $failed)) {
return $failed;
@@ -204,7 +212,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
foreach ($values as $key => $value) {
try {
$this->connection->upsert($key, $value, $upsertOptions);
} catch (\Exception) {
} catch (\Exception $exception) {
$ko[$key] = '';
}
}