From 1938cfedbb56472ed649512478100e2dbe195450 Mon Sep 17 00:00:00 2001 From: pgautier404 Date: Tue, 6 Jun 2023 17:25:31 -0700 Subject: [PATCH 1/6] chore: update examples and READMES for v1.3.0 (#167) --- README.ja.md | 2 +- examples/README.md | 2 +- examples/composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.ja.md b/README.ja.md index defaba93..6fc9d26d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -35,7 +35,7 @@ Momento Serverless Cache の PHP クライアント SDK:従来のキャッシ ```json { "require": { - "momentohq/client-sdk-php": "^1.2" + "momentohq/client-sdk-php": "^1.3" } } ``` diff --git a/examples/README.md b/examples/README.md index cd4994a1..b81b8daf 100644 --- a/examples/README.md +++ b/examples/README.md @@ -63,7 +63,7 @@ Add the repository and dependency to your project's `composer.json`: ```json { "require": { - "momentohq/client-sdk-php": "^1.2" + "momentohq/client-sdk-php": "^1.3" } } ``` diff --git a/examples/composer.json b/examples/composer.json index ee37d407..ab0e4f27 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -1,6 +1,6 @@ { "require": { - "momentohq/client-sdk-php": "1.2.0", + "momentohq/client-sdk-php": "1.3.0", "monolog/monolog": "^2.5" }, "config": { From 7227c08c2310a1a0cefda2157a23f537639a84c6 Mon Sep 17 00:00:00 2001 From: pgautier404 Date: Wed, 7 Jun 2023 13:40:17 -0700 Subject: [PATCH 2/6] feat: Improve PSR cache multiple operation performance (#165) * feat: Improve PSR cache multiple operation performance * fix: quick syntax fixes --------- Co-authored-by: Graham Campbell --- src/Cache/Psr16CacheClient.php | 82 ++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/src/Cache/Psr16CacheClient.php b/src/Cache/Psr16CacheClient.php index 686819b7..2d2298e5 100644 --- a/src/Cache/Psr16CacheClient.php +++ b/src/Cache/Psr16CacheClient.php @@ -176,13 +176,36 @@ public function clear(): bool */ public function getMultiple(iterable $keys, mixed $default = null): iterable { + $keyList = []; + foreach ($keys as $key) { validatePsr16Key($key); + $keyList[] = $key; } + $result = []; - foreach ($keys as $key) { - $result[$key] = $this->get($key, $default); + + foreach (array_chunk($keyList, 100) as $keyChunk) { + $futures = []; + + foreach ($keyChunk as $key) { + $futures[$key] = $this->momento->getAsync(self::CACHE_NAME, $key); + } + + foreach ($futures as $key => $future) { + $response = $future->wait(); + $error = $response->asError(); + if (null !== $error) { + $this->handleCacheError($error); + $result[$key] = $default; + } elseif (null !== $response->asMiss()) { + $result[$key] = $default; + } else { + $result[$key] = unserialize($response->asHit()->valueString()); + } + } } + return $result; } @@ -191,15 +214,40 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable */ public function setMultiple(iterable $values, DateInterval|int|null $ttl = null): bool { + $keyValueMap = []; + foreach ($values as $key => $value) { validatePsr16Key($key); + $keyValueMap[$key] = $value; } - foreach ($values as $key => $value) { - $result = $this->set($key, $value); - if ($result === false) { - return false; + + if (is_null($ttl)) { + $ttl = self::DEFAULT_TTL_SECONDS; + } elseif ($ttl instanceof DateInterval) { + $ttl = self::dateIntervalToSeconds($ttl); + } + + if ($ttl <= 0) { + return $this->deleteMultiple(array_keys($keyValueMap)); + } + + foreach (array_chunk($keyValueMap, 100, true) as $keyValueChunk) { + $futures = []; + + foreach ($keyValueChunk as $key => $value) { + $futures[$key] = $this->momento->setAsync(self::CACHE_NAME, $key, serialize($value), $ttl); + } + + foreach ($futures as $key => $future) { + $response = $future->wait(); + $error = $response->asError(); + if (null !== $error) { + $this->handleCacheError($error); + return false; + } } } + return true; } @@ -208,12 +256,30 @@ public function setMultiple(iterable $values, DateInterval|int|null $ttl = null) */ public function deleteMultiple(iterable $keys): bool { + $keyList = []; + foreach ($keys as $key) { validatePsr16Key($key); + $keyList[] = $key; } - foreach ($keys as $key) { - $this->delete($key); + + foreach (array_chunk($keyList, 100) as $keyChunk) { + $futures = []; + + foreach ($keyChunk as $key) { + $futures[$key] = $this->momento->deleteAsync(self::CACHE_NAME, $key); + } + + foreach ($futures as $key => $future) { + $response = $future->wait(); + $error = $response->asError(); + if (null !== $error) { + $this->handleCacheError($error); + return false; + } + } } + return true; } From ca6412b02ea18b835443c5cacec4b0d479431c70 Mon Sep 17 00:00:00 2001 From: pgautier404 Date: Mon, 12 Jun 2023 09:15:29 -0700 Subject: [PATCH 3/6] fix: allow users to override PSR-16 cache name (#166) * fix: allow users to override PSR-16 cache name * fix: make cache name argument nullable --- src/Cache/Psr16CacheClient.php | 16 ++++++++++------ tests/Cache/Psr16ClientTest.php | 32 +++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/Cache/Psr16CacheClient.php b/src/Cache/Psr16CacheClient.php index 2d2298e5..84f37893 100644 --- a/src/Cache/Psr16CacheClient.php +++ b/src/Cache/Psr16CacheClient.php @@ -16,11 +16,12 @@ class Psr16CacheClient implements CacheInterface { private CacheClient $momento; + private string $cacheName; // PSR-16 spec requires a default of as close to "forever" as the engine allows. // The below is set to a week and will be truncated as necessary for the cache // backend in use. private const DEFAULT_TTL_SECONDS = 604800; - private const CACHE_NAME = "momento-psr16"; + private const DEFAULT_CACHE_NAME = "momento-psr16"; private ?CacheException $lastError = null; private bool $throwExceptions = true; @@ -29,12 +30,14 @@ class Psr16CacheClient implements CacheInterface * @param ICredentialProvider $authProvider * @param int|null $defaultTtlSeconds * @param bool|null $throwExceptions + * @param string|null $cacheName */ public function __construct( IConfiguration $configuration, ICredentialProvider $authProvider, ?int $defaultTtlSeconds, - ?bool $throwExceptions = null + ?bool $throwExceptions = null, + ?string $cacheName = null ) { $ttlSeconds = $defaultTtlSeconds ?? self::DEFAULT_TTL_SECONDS; @@ -42,7 +45,8 @@ public function __construct( if (!is_null($throwExceptions)) { $this->throwExceptions = $throwExceptions; } - $response = $this->momento->createCache(self::CACHE_NAME); + $this->cacheName = $cacheName ?? self::DEFAULT_CACHE_NAME; + $response = $this->momento->createCache($this->cacheName); if ($error = $response->asError()) { $this->throwExceptions = true; $this->handleCacheError($error); @@ -110,7 +114,7 @@ public function getLastError(bool $clear_error = true): CacheException|null public function get(string $key, mixed $default = null): mixed { validatePsr16Key($key); - $response = $this->momento->get(self::CACHE_NAME, $key); + $response = $this->momento->get($this->cacheName, $key); if ($error = $response->asError()) { $this->handleCacheError($error); return $default; @@ -139,7 +143,7 @@ public function set(string $key, mixed $value, DateInterval|int|null $ttl = null return $this->delete($key); } - $response = $this->momento->set(self::CACHE_NAME, $key, serialize($value), $ttl); + $response = $this->momento->set($this->cacheName, $key, serialize($value), $ttl); if ($error = $response->asError()) { $this->handleCacheError($error); return false; @@ -153,7 +157,7 @@ public function set(string $key, mixed $value, DateInterval|int|null $ttl = null public function delete(string $key): bool { validatePsr16Key($key); - $response = $this->momento->delete(self::CACHE_NAME, $key); + $response = $this->momento->delete($this->cacheName, $key); if ($error = $response->asError()) { $this->handleCacheError($error); return false; diff --git a/tests/Cache/Psr16ClientTest.php b/tests/Cache/Psr16ClientTest.php index 22e296b2..ac7816ed 100644 --- a/tests/Cache/Psr16ClientTest.php +++ b/tests/Cache/Psr16ClientTest.php @@ -11,17 +11,17 @@ use Momento\Cache\Psr16CacheClient; use Momento\Cache\CacheClient; use Momento\Config\Configuration; +use Momento\Config\Configurations\Laptop; use Momento\Config\Transport\StaticGrpcConfiguration; use Momento\Config\Transport\StaticTransportStrategy; use Momento\Logging\NullLoggerFactory; -use Psr\Log\NullLogger; +use PHPUnit\Framework\TestCase; /** * @covers Psr16CacheClient */ -class Psr16ClientTest extends \PHPUnit\Framework\TestCase +class Psr16ClientTest extends TestCase { - private string $TEST_CACHE_NAME = "momento-psr16-test"; private int $DEFAULT_TTL_SECONDS = 10; private Psr16CacheClient $client; @@ -91,6 +91,32 @@ public function dataTypeProvider(): array ]; } + public function testOverrideDefaultCacheName() + { + $testCacheName = "PSR16-test-cache"; + $configuration = Laptop::latest(); + $authProvider = new EnvMomentoTokenProvider("TEST_AUTH_TOKEN"); + $client = new CacheClient( + $configuration, $authProvider, $this->DEFAULT_TTL_SECONDS + ); + $psrClient = new Psr16CacheClient( + $configuration, $authProvider, $this->DEFAULT_TTL_SECONDS, cacheName: $testCacheName + ); + $listResponse = $client->listCaches(); + $this->assertNull($listResponse->asError()); + $gotMatch = false; + foreach ($listResponse->asSuccess()->caches() as $cache) { + $cacheName = $cache->name(); + if ($cacheName === $testCacheName) { + $gotMatch = true; + break; + } + } + $this->assertTrue($gotMatch); + $deleteResponse = $client->deleteCache($testCacheName); + $this->assertNull($deleteResponse->asError()); + } + /** * @dataProvider dataTypeProvider */ From fd39e4cf4247bb0aa01d7676a4887422ca4ec0d7 Mon Sep 17 00:00:00 2001 From: pratik151192 Date: Mon, 7 Aug 2023 12:06:34 -0700 Subject: [PATCH 4/6] chore: Update README.md to include auth token generation instruction (#169) * Update README.md to include auth token generation instruction Also fixes cache name constant that doesnt exist --- README.md | 2 ++ README.template.md | 2 ++ src/Cache/Psr16CacheClient.php | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9403eb7f..604fe260 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Momento Cache is a fast, simple, pay-as-you-go caching solution without any of the operational overhead required by traditional caching solutions. This repo contains the source code for the Momento PHP client library. +To get started with Momento you will need a Momento Auth Token. You can get one from the [Momento Console](https://console.gomomento.com). + * Website: [https://www.gomomento.com/](https://www.gomomento.com/) * Momento Documentation: [https://docs.momentohq.com/](https://docs.momentohq.com/) * Getting Started: [https://docs.momentohq.com/getting-started](https://docs.momentohq.com/getting-started) diff --git a/README.template.md b/README.template.md index b18db3fd..58e9286d 100644 --- a/README.template.md +++ b/README.template.md @@ -14,6 +14,8 @@ The Momento PHP SDK package is available on packagist.org: [client-sdk-php](http ## Getting Started and Documentation +To get started with Momento you will need a Momento Auth Token. You can get one from the [Momento Console](https://console.gomomento.com). + Documentation is available on the [Momento Docs website](https://docs.momentohq.com). ## Examples diff --git a/src/Cache/Psr16CacheClient.php b/src/Cache/Psr16CacheClient.php index 84f37893..2e54e074 100644 --- a/src/Cache/Psr16CacheClient.php +++ b/src/Cache/Psr16CacheClient.php @@ -193,7 +193,7 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable $futures = []; foreach ($keyChunk as $key) { - $futures[$key] = $this->momento->getAsync(self::CACHE_NAME, $key); + $futures[$key] = $this->momento->getAsync(self::DEFAULT_CACHE_NAME, $key); } foreach ($futures as $key => $future) { @@ -239,7 +239,7 @@ public function setMultiple(iterable $values, DateInterval|int|null $ttl = null) $futures = []; foreach ($keyValueChunk as $key => $value) { - $futures[$key] = $this->momento->setAsync(self::CACHE_NAME, $key, serialize($value), $ttl); + $futures[$key] = $this->momento->setAsync(self::DEFAULT_CACHE_NAME, $key, serialize($value), $ttl); } foreach ($futures as $key => $future) { @@ -271,7 +271,7 @@ public function deleteMultiple(iterable $keys): bool $futures = []; foreach ($keyChunk as $key) { - $futures[$key] = $this->momento->deleteAsync(self::CACHE_NAME, $key); + $futures[$key] = $this->momento->deleteAsync(self::DEFAULT_CACHE_NAME, $key); } foreach ($futures as $key => $future) { From 3a4c18e0363d032d06201c6e3012a3100fb695a1 Mon Sep 17 00:00:00 2001 From: pratik151192 Date: Mon, 7 Aug 2023 19:10:21 +0000 Subject: [PATCH 5/6] Update templated README.md file --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 604fe260..ab71838f 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ if ($hit = $response->asHit()) { ## Getting Started and Documentation +To get started with Momento you will need a Momento Auth Token. You can get one from the [Momento Console](https://console.gomomento.com). + Documentation is available on the [Momento Docs website](https://docs.momentohq.com). ## Examples From f06e97de4aa8f2eacc6135f6cb2c343fba41b334 Mon Sep 17 00:00:00 2001 From: pgautier404 Date: Mon, 9 Oct 2023 10:37:29 -0700 Subject: [PATCH 6/6] feat: PHP 7.4 support (#171) * chore: adjust psr-log version to work with Drupal * chore: set PHP versions to 7.4 * chore: remove union-with-null types * chore: add psr/simple-cache downversion option * chore: removed references to mixed type * chore: capture all exceptions into vars * chore: removing more union types * chore: remove trailing comma * chore: remove union type * chore: update logfile for downversioned psr stuff * chore: remove named parameter * chore: remove use of 'match' * chore: remove str_ends_with usage * chore: remove throw in expression * chore: remove named params from tests * chore: update PSR16 method signatures * chore: fix straggling test * feat: bump version --- composer.json | 9 +- composer.lock | 550 +++++------------- src/Auth/AuthUtils.php | 2 +- src/Auth/CredentialProvider.php | 4 +- src/Auth/ICredentialProvider.php | 4 +- src/Auth/StringMomentoTokenProvider.php | 4 +- .../CacheOperationTypes.php | 144 ++--- src/Cache/Errors/Errors.php | 8 +- src/Cache/Internal/ScsControlClient.php | 4 +- src/Cache/Internal/ScsDataClient.php | 19 +- src/Cache/Psr16CacheClient.php | 16 +- .../Transport/StaticGrpcConfiguration.php | 4 +- .../Transport/StaticTransportStrategy.php | 4 +- src/Logging/LoggerFactoryBase.php | 2 +- src/Logging/StderrLogger.php | 10 +- src/Requests/CollectionTtl.php | 4 +- tests/Cache/CacheClientTest.php | 128 ++-- tests/Cache/Psr16ClientTest.php | 4 +- 18 files changed, 349 insertions(+), 571 deletions(-) diff --git a/composer.json b/composer.json index 9c8af2ac..8e0c2c77 100644 --- a/composer.json +++ b/composer.json @@ -39,22 +39,19 @@ } }, "require": { - "php": ">=8.0", + "php": ">=7.4", "ext-grpc": "*", "firebase/php-jwt": "^6.3", "google/protobuf": "3.22.3", "grpc/grpc": "1.52.0", - "psr/log": "^2.0 || ^3.0", - "psr/simple-cache": "^3.0" + "psr/log": "^1.1 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0.1 || ^3.0" }, "require-dev": { "composer/composer": "^2.4.1", "phpunit/phpunit": "^9.5.23" }, "config": { - "platform": { - "php": "8.0" - }, "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true diff --git a/composer.lock b/composer.lock index 01b0d886..ef778f03 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2a5a36d34cd9818c6d95e5a0d6b6ed64", + "content-hash": "315b173030672bf79996957c7ca1f4a4", "packages": [ { "name": "firebase/php-jwt", - "version": "v6.5.0", + "version": "v6.8.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2" + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", "shasum": "" }, "require": { @@ -63,11 +63,7 @@ "jwt", "php" ], - "support": { - "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.5.0" - }, - "time": "2023-05-12T15:47:07+00:00" + "time": "2023-07-14T18:33:00+00:00" }, { "name": "google/protobuf", @@ -159,30 +155,30 @@ }, { "name": "psr/log", - "version": "2.0.0", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -202,32 +198,29 @@ "psr", "psr-3" ], - "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" - }, - "time": "2021-07-14T16:41:46+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "psr/simple-cache", - "version": "3.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -242,7 +235,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -253,25 +246,22 @@ "psr-16", "simple-cache" ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" - }, - "time": "2021-10-29T13:26:27+00:00" + "time": "2017-10-23T01:57:42+00:00" } ], "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", "shasum": "" }, "require": { @@ -315,11 +305,6 @@ "ssl", "tls" ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" - }, "funding": [ { "url": "https://packagist.com", @@ -334,26 +319,26 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-08-30T09:31:38+00:00" }, { "name": "composer/class-map-generator", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", "shasum": "" }, "require": { - "composer/pcre": "^2 || ^3", + "composer/pcre": "^2.1 || ^3.1", "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.6", @@ -389,10 +374,6 @@ "keywords": [ "classmap" ], - "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.0.0" - }, "funding": [ { "url": "https://packagist.com", @@ -407,20 +388,20 @@ "type": "tidelift" } ], - "time": "2022-06-19T11:31:27+00:00" + "time": "2023-06-30T13:58:57+00:00" }, { "name": "composer/composer", - "version": "2.5.7", + "version": "2.6.4", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d477018d3f2ebd76dede3d3988a0b1a7add4d81e" + "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d477018d3f2ebd76dede3d3988a0b1a7add4d81e", - "reference": "d477018d3f2ebd76dede3d3988a0b1a7add4d81e", + "url": "https://api.github.com/repos/composer/composer/zipball/d75d17c16a863438027d1d96401cddcd6aa5bb60", + "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60", "shasum": "" }, "require": { @@ -428,23 +409,23 @@ "composer/class-map-generator": "^1.0", "composer/metadata-minifier": "^1.0", "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.0", + "composer/semver": "^3.2.5", "composer/spdx-licenses": "^1.5.7", "composer/xdebug-handler": "^2.0.2 || ^3.0.3", "justinrainbow/json-schema": "^5.2.11", "php": "^7.2.5 || ^8.0", "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.8", + "react/promise": "^2.8 || ^3", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.2", "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", + "symfony/console": "^5.4.11 || ^6.0.11 || ^7", + "symfony/filesystem": "^5.4 || ^6.0 || ^7", + "symfony/finder": "^5.4 || ^6.0 || ^7", "symfony/polyfill-php73": "^1.24", "symfony/polyfill-php80": "^1.24", "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4 || ^6.0" + "symfony/process": "^5.4 || ^6.0 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.9.3", @@ -452,7 +433,7 @@ "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1", "phpstan/phpstan-symfony": "^1.2.10", - "symfony/phpunit-bridge": "^6.0" + "symfony/phpunit-bridge": "^6.0 || ^7" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -465,7 +446,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "2.6-dev" }, "phpstan": { "includes": [ @@ -475,7 +456,7 @@ }, "autoload": { "psr-4": { - "Composer\\": "src/Composer" + "Composer\\": "src/Composer/" } }, "notification-url": "https://packagist.org/downloads/", @@ -501,11 +482,6 @@ "dependency", "package" ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.5.7" - }, "funding": [ { "url": "https://packagist.com", @@ -520,7 +496,7 @@ "type": "tidelift" } ], - "time": "2023-05-24T13:00:40+00:00" + "time": "2023-09-29T08:54:47+00:00" }, { "name": "composer/metadata-minifier", @@ -571,10 +547,6 @@ "composer", "compression" ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" - }, "funding": [ { "url": "https://packagist.com", @@ -642,10 +614,6 @@ "regex", "regular expression" ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" - }, "funding": [ { "url": "https://packagist.com", @@ -664,16 +632,16 @@ }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -722,11 +690,6 @@ "validation", "versioning" ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, "funding": [ { "url": "https://packagist.com", @@ -741,7 +704,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/spdx-licenses", @@ -802,11 +765,6 @@ "spdx", "validator" ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" - }, "funding": [ { "url": "https://packagist.com", @@ -868,11 +826,6 @@ "Xdebug", "performance" ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, "funding": [ { "url": "https://packagist.com", @@ -939,10 +892,6 @@ "constructor", "instantiate" ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -961,16 +910,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "v5.2.13", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, "require": { @@ -1023,11 +972,7 @@ "json", "schema" ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" - }, - "time": "2022-04-13T08:02:27+00:00" + "time": "2023-09-26T02:20:38+00:00" }, { "name": "myclabs/deep-copy", @@ -1076,10 +1021,6 @@ "object", "object graph" ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", @@ -1090,16 +1031,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1138,11 +1079,7 @@ "parser", "php" ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" - }, - "time": "2023-05-19T20:20:00+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -1198,10 +1135,6 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, "time": "2021-07-20T11:28:43+00:00" }, { @@ -1249,24 +1182,20 @@ } ], "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { @@ -1320,17 +1249,13 @@ "testing", "xunit" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1380,10 +1305,6 @@ "filesystem", "iterator" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1443,10 +1364,6 @@ "keywords": [ "process" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1502,10 +1419,6 @@ "keywords": [ "template" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1561,10 +1474,6 @@ "keywords": [ "timer" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1575,16 +1484,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "9.6.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", "shasum": "" }, "require": { @@ -1599,7 +1508,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-code-coverage": "^9.2.28", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -1655,11 +1564,6 @@ "testing", "xunit" ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" - }, "funding": [ { "url": "https://phpunit.de/sponsors.html", @@ -1674,7 +1578,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-09-19T05:39:22+00:00" }, { "name": "psr/container", @@ -1718,31 +1622,28 @@ "container-interop", "psr" ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, "time": "2021-11-05T16:50:12+00:00" }, { "name": "react/promise", - "version": "v2.10.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" + "reference": "c86753c76fd3be465d93b308f18d189f01a22be4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "url": "https://api.github.com/repos/reactphp/promise/zipball/c86753c76fd3be465d93b308f18d189f01a22be4", + "reference": "c86753c76fd3be465d93b308f18d189f01a22be4", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" + "phpstan/phpstan": "1.10.20 || 1.4.10", + "phpunit/phpunit": "^9.5 || ^7.5" }, "type": "library", "autoload": { @@ -1784,17 +1685,13 @@ "promise", "promises" ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.10.0" - }, "funding": [ { "url": "https://opencollective.com/reactphp", "type": "open_collective" } ], - "time": "2023-05-02T15:15:43+00:00" + "time": "2023-07-11T16:12:49+00:00" }, { "name": "sebastian/cli-parser", @@ -1840,10 +1737,6 @@ ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1896,10 +1789,6 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1951,10 +1840,6 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2025,10 +1910,6 @@ "compare", "equality" ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2082,10 +1963,6 @@ ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2148,10 +2025,6 @@ "unidiff", "unified diff" ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2211,10 +2084,6 @@ "environment", "hhvm" ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2288,10 +2157,6 @@ "export", "exporter" ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2302,16 +2167,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -2352,17 +2217,13 @@ "keywords": [ "global state" ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -2409,10 +2270,6 @@ ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2466,10 +2323,6 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2521,10 +2374,6 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2584,10 +2433,6 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2639,10 +2484,6 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2695,10 +2536,6 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2748,10 +2585,6 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2808,10 +2641,6 @@ "parser", "validator" ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" - }, "funding": [ { "url": "https://github.com/Seldaek", @@ -2866,24 +2695,20 @@ "keywords": [ "phar" ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" - }, "time": "2022-08-31T10:31:18+00:00" }, { "name": "seld/signal-handler", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "f69d119511dc0360440cdbdaa71829c149b7be75" + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/f69d119511dc0360440cdbdaa71829c149b7be75", - "reference": "f69d119511dc0360440cdbdaa71829c149b7be75", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", "shasum": "" }, "require": { @@ -2927,24 +2752,20 @@ "sigterm", "unix" ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.1" - }, - "time": "2022-07-20T18:31:45+00:00" + "time": "2023-09-03T09:24:00+00:00" }, { "name": "symfony/console", - "version": "v5.4.23", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -3013,9 +2834,6 @@ "console", "terminal" ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.23" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3030,7 +2848,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T18:47:29+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3080,9 +2898,6 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3101,16 +2916,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -3144,9 +2959,6 @@ ], "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3161,20 +2973,20 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/finder", - "version": "v5.4.21", + "version": "v5.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", "shasum": "" }, "require": { @@ -3207,9 +3019,6 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.21" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3224,20 +3033,20 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:33:00+00:00" + "time": "2023-07-31T08:02:31+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -3252,7 +3061,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3289,9 +3098,6 @@ "polyfill", "portable" ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3306,20 +3112,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3331,7 +3137,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3370,9 +3176,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3387,20 +3190,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -3412,7 +3215,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3454,9 +3257,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3471,20 +3271,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -3499,7 +3299,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3537,9 +3337,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3554,20 +3351,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -3576,7 +3373,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3616,9 +3413,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3633,20 +3427,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -3655,7 +3449,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3699,9 +3493,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3716,20 +3507,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -3738,7 +3529,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3778,9 +3569,6 @@ "portable", "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3795,20 +3583,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v5.4.23", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", + "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", "shasum": "" }, "require": { @@ -3840,9 +3628,6 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.4.23" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3857,7 +3642,7 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:50:24+00:00" + "time": "2023-08-07T10:36:04+00:00" }, { "name": "symfony/service-contracts", @@ -3923,9 +3708,6 @@ "interoperability", "standards" ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3944,16 +3726,16 @@ }, { "name": "symfony/string", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -4009,9 +3791,6 @@ "utf-8", "utf8" ], - "support": { - "source": "https://github.com/symfony/string/tree/v5.4.22" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4026,7 +3805,7 @@ "type": "tidelift" } ], - "time": "2023-03-14T06:11:53+00:00" + "time": "2023-06-28T12:46:07+00:00" }, { "name": "theseer/tokenizer", @@ -4066,10 +3845,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, "funding": [ { "url": "https://github.com/theseer", @@ -4085,12 +3860,9 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0", + "php": ">=7.4", "ext-grpc": "*" }, "platform-dev": [], - "platform-overrides": { - "php": "8.0" - }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "1.1.0" } diff --git a/src/Auth/AuthUtils.php b/src/Auth/AuthUtils.php index 22d0221e..3ab8a55b 100644 --- a/src/Auth/AuthUtils.php +++ b/src/Auth/AuthUtils.php @@ -48,7 +48,7 @@ public static function parseJwtToken(string $authToken): object $payload = $exploded[1]; $payload = JWT::jsonDecode(JWT::urlsafeB64Decode($payload)); $payload->authToken = $authToken; - } catch (\Exception) { + } catch (\Exception $e) { self::throwBadAuthToken(); } diff --git a/src/Auth/CredentialProvider.php b/src/Auth/CredentialProvider.php index accc435b..4b07add5 100644 --- a/src/Auth/CredentialProvider.php +++ b/src/Auth/CredentialProvider.php @@ -28,12 +28,12 @@ public abstract function getCacheEndpoint(): string; /** * @return string|null Used for routing gRPC calls through a proxy server */ - public abstract function getTrustedControlEndpointCertificateName(): string|null; + public abstract function getTrustedControlEndpointCertificateName(): ?string; /** * @return string|null Used for routing gRPC calls through a proxy server */ - public abstract function getTrustedCacheEndpointCertificateName(): string|null; + public abstract function getTrustedCacheEndpointCertificateName(): ?string; /** * Convenience method for reading and parsing a JWT token stored as a string. diff --git a/src/Auth/ICredentialProvider.php b/src/Auth/ICredentialProvider.php index d9070ec6..882e416c 100644 --- a/src/Auth/ICredentialProvider.php +++ b/src/Auth/ICredentialProvider.php @@ -27,10 +27,10 @@ public function getCacheEndpoint(): string; /** * @return string|null Used for routing gRPC calls through a proxy server */ - public function getTrustedControlEndpointCertificateName(): string|null; + public function getTrustedControlEndpointCertificateName(): ?string; /** * @return string|null Used for routing gRPC calls through a proxy server */ - public function getTrustedCacheEndpointCertificateName(): string|null; + public function getTrustedCacheEndpointCertificateName(): ?string; } diff --git a/src/Auth/StringMomentoTokenProvider.php b/src/Auth/StringMomentoTokenProvider.php index 8841aae5..051ce4a5 100644 --- a/src/Auth/StringMomentoTokenProvider.php +++ b/src/Auth/StringMomentoTokenProvider.php @@ -69,7 +69,7 @@ public function getControlEndpoint(): string /** * @return string|null Used for routing gRPC calls through a proxy server */ - public function getTrustedControlEndpointCertificateName(): string|null + public function getTrustedControlEndpointCertificateName(): ?string { return $this->trustedControlEndpointCertificateName; } @@ -77,7 +77,7 @@ public function getTrustedControlEndpointCertificateName(): string|null /** * @return string|null Used for routing gRPC calls through a proxy server */ - public function getTrustedCacheEndpointCertificateName(): string|null + public function getTrustedCacheEndpointCertificateName(): ?string { return $this->trustedCacheEndpointCertificateName; } diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 3062e85a..c448b509 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -164,7 +164,9 @@ public function wait(): ResponseBase $this->response = fn () => $response; } catch (Throwable $e) { - $this->response = fn () => throw $e; + $this->response = function () use ($e) { + throw $e; + }; } } @@ -261,7 +263,7 @@ abstract class CreateCacheResponse extends ResponseBase /** * @return CreateCacheSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): CreateCacheSuccess|null + public function asSuccess(): ?CreateCacheSuccess { if ($this->isSuccess()) { return $this; @@ -272,7 +274,7 @@ public function asSuccess(): CreateCacheSuccess|null /** * @return CreateCacheError|null Returns the error subtype if the request was successful and null otherwise. */ - public function asError(): CreateCacheError|null + public function asError(): ?CreateCacheError { if ($this->isError()) { return $this; @@ -283,7 +285,7 @@ public function asError(): CreateCacheError|null /** * @return CreateCacheAlreadyExists|null Returns the "already exists" subtype if the request was successful and null otherwise. */ - public function asAlreadyExists(): CreateCacheAlreadyExists|null + public function asAlreadyExists(): ?CreateCacheAlreadyExists { if ($this->isAlreadyExists()) { return $this; @@ -338,7 +340,7 @@ abstract class DeleteCacheResponse extends ResponseBase /** * @return DeleteCacheSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DeleteCacheSuccess|null + public function asSuccess(): ?DeleteCacheSuccess { if ($this->isSuccess()) { return $this; @@ -349,7 +351,7 @@ public function asSuccess(): DeleteCacheSuccess|null /** * @return DeleteCacheError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DeleteCacheError|null + public function asError(): ?DeleteCacheError { if ($this->isError()) { return $this; @@ -395,7 +397,7 @@ abstract class ListCachesResponse extends ResponseBase /** * @return ListCachesSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): ListCachesSuccess|null + public function asSuccess(): ?ListCachesSuccess { if ($this->isSuccess()) { return $this; @@ -406,7 +408,7 @@ public function asSuccess(): ListCachesSuccess|null /** * @return ListCachesError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListCachesError|null + public function asError(): ?ListCachesError { if ($this->isError()) { return $this; @@ -479,7 +481,7 @@ abstract class SetResponse extends ResponseBase /** * @return SetSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): SetSuccess|null + public function asSuccess(): ?SetSuccess { if ($this->isSuccess()) { return $this; @@ -490,7 +492,7 @@ public function asSuccess(): SetSuccess|null /** * @return SetError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetError|null + public function asError(): ?SetError { if ($this->isError()) { return $this; @@ -541,7 +543,7 @@ abstract class GetResponse extends ResponseBase /** * @return GetHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): GetHit|null + public function asHit(): ?GetHit { if ($this->isHit()) { return $this; @@ -552,7 +554,7 @@ public function asHit(): GetHit|null /** * @return GetMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): GetMiss|null + public function asMiss(): ?GetMiss { if ($this->isMiss()) { return $this; @@ -563,7 +565,7 @@ public function asMiss(): GetMiss|null /** * @return GetError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): GetError|null + public function asError(): ?GetError { if ($this->isError()) { return $this; @@ -640,7 +642,7 @@ abstract class SetIfNotExistsResponse extends ResponseBase /** * @return SetIfNotExistsStored|null Returns the subtype for a successfully stored value and null otherwise. */ - public function asStored(): SetIfNotExistsStored|null + public function asStored(): ?SetIfNotExistsStored { if ($this->isStored()) { return $this; @@ -651,7 +653,7 @@ public function asStored(): SetIfNotExistsStored|null /** * @return SetIfNotExistsNotStored|null Returns the subtype indicating the value was not stored and null otherwise. */ - public function asNotStored(): SetIfNotExistsNotStored|null + public function asNotStored(): ?SetIfNotExistsNotStored { if($this->isNotStored()) { return $this; @@ -662,7 +664,7 @@ public function asNotStored(): SetIfNotExistsNotStored|null /** * @return SetIfNotExistsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetIfNotExistsError|null + public function asError(): ?SetIfNotExistsError { if ($this->isError()) { return $this; @@ -714,7 +716,7 @@ abstract class DeleteResponse extends ResponseBase /** * @return DeleteSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DeleteSuccess|null + public function asSuccess(): ?DeleteSuccess { if ($this->isSuccess()) { return $this; @@ -725,7 +727,7 @@ public function asSuccess(): DeleteSuccess|null /** * @return DeleteError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DeleteError|null + public function asError(): ?DeleteError { if ($this->isError()) { return $this; @@ -775,7 +777,7 @@ abstract class KeysExistResponse extends ResponseBase /** * @return KeysExistSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess() : KeysExistSuccess|null + public function asSuccess() : ?KeysExistSuccess { if ($this->isSuccess()) { return $this; @@ -786,7 +788,7 @@ public function asSuccess() : KeysExistSuccess|null /** * @return KeysExistError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError() : KeysExistError|null + public function asError() : ?KeysExistError { if ($this->isError()) { return $this; @@ -858,7 +860,7 @@ abstract class KeyExistsResponse extends ResponseBase /** * @return KeyExistsSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess() : KeyExistsSuccess|null + public function asSuccess() : ?KeyExistsSuccess { if ($this->isSuccess()) { return $this; @@ -869,7 +871,7 @@ public function asSuccess() : KeyExistsSuccess|null /** * @return KeyExistsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError() : KeyExistsError|null + public function asError() : ?KeyExistsError { if ($this->isError()) { return $this; @@ -928,7 +930,7 @@ abstract class IncrementResponse extends ResponseBase /** * @return IncrementSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess() : IncrementSuccess|null + public function asSuccess() : ?IncrementSuccess { if ($this->isSuccess()) { return $this; @@ -939,7 +941,7 @@ public function asSuccess() : IncrementSuccess|null /** * @return IncrementError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError() : IncrementError|null + public function asError() : ?IncrementError { if ($this->isError()) { return $this; @@ -1000,7 +1002,7 @@ abstract class ListFetchResponse extends ResponseBase /** * @return ListFetchHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): ListFetchHit|null + public function asHit(): ?ListFetchHit { if ($this->isHit()) { return $this; @@ -1011,7 +1013,7 @@ public function asHit(): ListFetchHit|null /** * @return ListFetchMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): ListFetchMiss|null + public function asMiss(): ?ListFetchMiss { if ($this->isMiss()) { return $this; @@ -1022,7 +1024,7 @@ public function asMiss(): ListFetchMiss|null /** * @return ListFetchError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListFetchError|null + public function asError(): ?ListFetchError { if ($this->isError()) { return $this; @@ -1103,7 +1105,7 @@ abstract class ListPushFrontResponse extends ResponseBase /** * @return ListPushFrontSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): ListPushFrontSuccess|null + public function asSuccess(): ?ListPushFrontSuccess { if ($this->isSuccess()) { return $this; @@ -1114,7 +1116,7 @@ public function asSuccess(): ListPushFrontSuccess|null /** * @return ListPushFrontError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListPushFrontError|null + public function asError(): ?ListPushFrontError { if ($this->isError()) { return $this; @@ -1181,7 +1183,7 @@ abstract class ListPushBackResponse extends ResponseBase /** * @return ListPushBackSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): ListPushBackSuccess|null + public function asSuccess(): ?ListPushBackSuccess { if ($this->isSuccess()) { return $this; @@ -1192,7 +1194,7 @@ public function asSuccess(): ListPushBackSuccess|null /** * @return ListPushBackError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListPushBackError|null + public function asError(): ?ListPushBackError { if ($this->isError()) { return $this; @@ -1262,7 +1264,7 @@ abstract class ListPopFrontResponse extends ResponseBase /** * @return ListPopFrontHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): ListPopFrontHit|null + public function asHit(): ?ListPopFrontHit { if ($this->isHit()) { return $this; @@ -1273,7 +1275,7 @@ public function asHit(): ListPopFrontHit|null /** * @return ListPopFrontMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): ListPopFrontMiss|null + public function asMiss(): ?ListPopFrontMiss { if ($this->isMiss()) { return $this; @@ -1284,7 +1286,7 @@ public function asMiss(): ListPopFrontMiss|null /** * @return ListPopFrontError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListPopFrontError|null + public function asError(): ?ListPopFrontError { if ($this->isError()) { return $this; @@ -1361,7 +1363,7 @@ abstract class ListPopBackResponse extends ResponseBase /** * @return ListPopBackHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): ListPopBackHit|null + public function asHit(): ?ListPopBackHit { if ($this->isHit()) { return $this; @@ -1372,7 +1374,7 @@ public function asHit(): ListPopBackHit|null /** * @return ListPopBackMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): ListPopBackMiss|null + public function asMiss(): ?ListPopBackMiss { if ($this->isMiss()) { return $this; @@ -1383,7 +1385,7 @@ public function asMiss(): ListPopBackMiss|null /** * @return ListPopBackError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListPopBackError|null + public function asError(): ?ListPopBackError { if ($this->isError()) { return $this; @@ -1457,7 +1459,7 @@ abstract class ListRemoveValueResponse extends ResponseBase /** * @return ListRemoveValueSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): ListRemoveValueSuccess|null + public function asSuccess(): ?ListRemoveValueSuccess { if ($this->isSuccess()) { return $this; @@ -1468,7 +1470,7 @@ public function asSuccess(): ListRemoveValueSuccess|null /** * @return ListRemoveValueError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListRemoveValueError|null + public function asError(): ?ListRemoveValueError { if ($this->isError()) { return $this; @@ -1515,7 +1517,7 @@ abstract class ListLengthResponse extends ResponseBase /** * @return ListLengthSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): ListLengthSuccess|null + public function asSuccess(): ?ListLengthSuccess { if ($this->isSuccess()) { return $this; @@ -1526,7 +1528,7 @@ public function asSuccess(): ListLengthSuccess|null /** * @return ListLengthError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ListLengthError|null + public function asError(): ?ListLengthError { if ($this->isError()) { return $this; @@ -1593,7 +1595,7 @@ abstract class DictionarySetFieldResponse extends ResponseBase /** * @return DictionarySetFieldSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DictionarySetFieldSuccess|null + public function asSuccess(): ?DictionarySetFieldSuccess { if ($this->isSuccess()) { return $this; @@ -1604,7 +1606,7 @@ public function asSuccess(): DictionarySetFieldSuccess|null /** * @return DictionarySetFieldError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionarySetFieldError|null + public function asError(): ?DictionarySetFieldError { if ($this->isError()) { return $this; @@ -1654,7 +1656,7 @@ abstract class DictionaryGetFieldResponse extends ResponseBase /** * @return DictionaryGetFieldHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): DictionaryGetFieldHit|null + public function asHit(): ?DictionaryGetFieldHit { if ($this->isHit()) { return $this; @@ -1665,7 +1667,7 @@ public function asHit(): DictionaryGetFieldHit|null /** * @return DictionaryGetFieldMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): DictionaryGetFieldMiss|null + public function asMiss(): ?DictionaryGetFieldMiss { if ($this->isMiss()) { return $this; @@ -1676,7 +1678,7 @@ public function asMiss(): DictionaryGetFieldMiss|null /** * @return DictionaryGetFieldError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryGetFieldError|null + public function asError(): ?DictionaryGetFieldError { if ($this->isError()) { return $this; @@ -1768,7 +1770,7 @@ abstract class DictionaryFetchResponse extends ResponseBase /** * @return DictionaryFetchHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): DictionaryFetchHit|null + public function asHit(): ?DictionaryFetchHit { if ($this->isHit()) { return $this; @@ -1779,7 +1781,7 @@ public function asHit(): DictionaryFetchHit|null /** * @return DictionaryFetchMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): DictionaryFetchMiss|null + public function asMiss(): ?DictionaryFetchMiss { if ($this->isMiss()) { return $this; @@ -1790,7 +1792,7 @@ public function asMiss(): DictionaryFetchMiss|null /** * @return DictionaryFetchError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryFetchError|null + public function asError(): ?DictionaryFetchError { if ($this->isError()) { return $this; @@ -1868,7 +1870,7 @@ abstract class DictionarySetFieldsResponse extends ResponseBase /** * @return DictionarySetFieldsSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DictionarySetFieldsSuccess|null + public function asSuccess(): ?DictionarySetFieldsSuccess { if ($this->isSuccess()) { return $this; @@ -1879,7 +1881,7 @@ public function asSuccess(): DictionarySetFieldsSuccess|null /** * @return DictionarySetFieldsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionarySetFieldsError|null + public function asError(): ?DictionarySetFieldsError { if ($this->isError()) { return $this; @@ -1930,7 +1932,7 @@ abstract class DictionaryGetFieldsResponse extends ResponseBase /** * @return DictionaryGetFieldsHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): DictionaryGetFieldsHit|null + public function asHit(): ?DictionaryGetFieldsHit { if ($this->isHit()) { return $this; @@ -1941,7 +1943,7 @@ public function asHit(): DictionaryGetFieldsHit|null /** * @return DictionaryGetFieldsMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): DictionaryGetFieldsMiss|null + public function asMiss(): ?DictionaryGetFieldsMiss { if ($this->isMiss()) { return $this; @@ -1952,7 +1954,7 @@ public function asMiss(): DictionaryGetFieldsMiss|null /** * @return DictionaryGetFieldsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryGetFieldsError|null + public function asError(): ?DictionaryGetFieldsError { if ($this->isError()) { return $this; @@ -2048,7 +2050,7 @@ abstract class DictionaryIncrementResponse extends ResponseBase /** * @return DictionaryIncrementSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DictionaryIncrementSuccess|null + public function asSuccess(): ?DictionaryIncrementSuccess { if ($this->isSuccess()) { return $this; @@ -2059,7 +2061,7 @@ public function asSuccess(): DictionaryIncrementSuccess|null /** * @return DictionaryIncrementError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryIncrementError|null + public function asError(): ?DictionaryIncrementError { if ($this->isError()) { return $this; @@ -2127,7 +2129,7 @@ abstract class DictionaryRemoveFieldResponse extends ResponseBase /** * @return DictionaryRemoveFieldSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DictionaryRemoveFieldSuccess|null + public function asSuccess(): ?DictionaryRemoveFieldSuccess { if ($this->isSuccess()) { return $this; @@ -2138,7 +2140,7 @@ public function asSuccess(): DictionaryRemoveFieldSuccess|null /** * @return DictionaryRemoveFieldError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryRemoveFieldError|null + public function asError(): ?DictionaryRemoveFieldError { if ($this->isError()) { return $this; @@ -2185,7 +2187,7 @@ abstract class DictionaryRemoveFieldsResponse extends ResponseBase /** * @return DictionaryRemoveFieldsSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): DictionaryRemoveFieldsSuccess|null + public function asSuccess(): ?DictionaryRemoveFieldsSuccess { if ($this->isSuccess()) { return $this; @@ -2196,7 +2198,7 @@ public function asSuccess(): DictionaryRemoveFieldsSuccess|null /** * @return DictionaryRemoveFieldsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): DictionaryRemoveFieldsError|null + public function asError(): ?DictionaryRemoveFieldsError { if ($this->isError()) { return $this; @@ -2243,7 +2245,7 @@ abstract class SetAddElementResponse extends ResponseBase /** * @return SetAddElementSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): SetAddElementSuccess|null + public function asSuccess(): ?SetAddElementSuccess { if ($this->isSuccess()) { return $this; @@ -2254,7 +2256,7 @@ public function asSuccess(): SetAddElementSuccess|null /** * @return SetAddElementError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetAddElementError|null + public function asError(): ?SetAddElementError { if ($this->isError()) { return $this; @@ -2300,7 +2302,7 @@ abstract class SetAddElementsResponse extends ResponseBase /** * @return SetAddElementsSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): SetAddElementsSuccess|null + public function asSuccess(): ?SetAddElementsSuccess { if ($this->isSuccess()) { return $this; @@ -2311,7 +2313,7 @@ public function asSuccess(): SetAddElementsSuccess|null /** * @return SetAddElementsError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetAddElementsError|null + public function asError(): ?SetAddElementsError { if ($this->isError()) { return $this; @@ -2362,7 +2364,7 @@ abstract class SetFetchResponse extends ResponseBase /** * @return SetFetchHit|null Returns the hit subtype if the request returned an error and null otherwise. */ - public function asHit(): SetFetchHit|null + public function asHit(): ?SetFetchHit { if ($this->isHit()) { return $this; @@ -2373,7 +2375,7 @@ public function asHit(): SetFetchHit|null /** * @return SetFetchMiss|null Returns the miss subtype if the request returned an error and null otherwise. */ - public function asMiss(): SetFetchMiss|null + public function asMiss(): ?SetFetchMiss { if ($this->isMiss()) { return $this; @@ -2384,7 +2386,7 @@ public function asMiss(): SetFetchMiss|null /** * @return SetFetchError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetFetchError|null + public function asError(): ?SetFetchError { if ($this->isError()) { return $this; @@ -2461,7 +2463,7 @@ abstract class SetLengthResponse extends ResponseBase /** * @return SetLengthSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): SetLengthSuccess|null + public function asSuccess(): ?SetLengthSuccess { if ($this->isSuccess()) { return $this; @@ -2472,7 +2474,7 @@ public function asSuccess(): SetLengthSuccess|null /** * @return SetLengthError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetLengthError|null + public function asError(): ?SetLengthError { if ($this->isError()) { return $this; @@ -2540,7 +2542,7 @@ abstract class SetRemoveElementResponse extends ResponseBase /** * @return SetRemoveElementSuccess|null Returns the success subtype if the request was successful and null otherwise. */ - public function asSuccess(): SetRemoveElementSuccess|null + public function asSuccess(): ?SetRemoveElementSuccess { if ($this->isSuccess()) { return $this; @@ -2551,7 +2553,7 @@ public function asSuccess(): SetRemoveElementSuccess|null /** * @return SetRemoveElementError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): SetRemoveElementError|null + public function asError(): ?SetRemoveElementError { if ($this->isError()) { return $this; diff --git a/src/Cache/Errors/Errors.php b/src/Cache/Errors/Errors.php index d5a2918e..310a1dc6 100644 --- a/src/Cache/Errors/Errors.php +++ b/src/Cache/Errors/Errors.php @@ -84,9 +84,9 @@ class MomentoGrpcErrorDetails /** * @var mixed|null Headers and other information about the error response */ - public mixed $metadata; + public $metadata; - public function __construct(int $code, string $details, mixed $metadata = null) + public function __construct(int $code, string $details, $metadata = null) { $this->code = $code; $this->details = $details; @@ -128,14 +128,14 @@ abstract class SdkError extends \Exception public string $messageWrapper; public function __construct( - string $message, int $code = 0, ?\Throwable $previous = null, mixed $metadata = null + string $message, int $code = 0, ?\Throwable $previous = null, $metadata = null ) { parent::__construct($message, $code, $previous); $this->setTransportDetails($code, $message, $metadata); } - public function setTransportDetails(int $code, string $details, mixed $metadata) + public function setTransportDetails(int $code, string $details, $metadata) { $grpcDetails = new MomentoGrpcErrorDetails($code, $details, $metadata); $this->transportDetails = new MomentoErrorTransportDetails($grpcDetails); diff --git a/src/Cache/Internal/ScsControlClient.php b/src/Cache/Internal/ScsControlClient.php index 20452f7b..370d49e2 100644 --- a/src/Cache/Internal/ScsControlClient.php +++ b/src/Cache/Internal/ScsControlClient.php @@ -46,7 +46,7 @@ public function setLogger(LoggerInterface $logger): void $this->logger = $logger; } - private function processCall(UnaryCall $call): mixed + private function processCall(UnaryCall $call) { [$response, $status] = $call->wait(); if ($status->code !== 0) { @@ -63,7 +63,7 @@ public function createCache(string $cacheName): CreateCacheResponse $request->setCacheName($cacheName); $call = $this->grpcManager->client->CreateCache($request); $this->processCall($call); - } catch (AlreadyExistsError) { + } catch (AlreadyExistsError $e) { return new CreateCacheAlreadyExists(); } catch (SdkError $e) { $this->logger->debug("Failed to create cache $cacheName: {$e->getMessage()}"); diff --git a/src/Cache/Internal/ScsDataClient.php b/src/Cache/Internal/ScsDataClient.php index e708d31b..64e5310f 100644 --- a/src/Cache/Internal/ScsDataClient.php +++ b/src/Cache/Internal/ScsDataClient.php @@ -195,7 +195,7 @@ private function returnCollectionTtl(?CollectionTtl $ttl): CollectionTtl return $ttl; } - private function processCall(UnaryCall $call): mixed + private function processCall(UnaryCall $call) { [$response, $status] = $call->wait(); if ($status->code !== 0) { @@ -270,12 +270,13 @@ function () use ($call): GetResponse { try { $response = $this->processCall($call); $result = $response->getResult(); - - return match ($result) { - ECacheResult::Hit => new GetHit($response), - ECacheResult::Miss => new GetMiss(), - default => throw new InternalServerError("CacheService returned an unexpected result: $result"), - }; + if ($result == ECacheResult::Hit) { + return new GetHit($response); + } elseif ($result == ECacheResult::Miss) { + return new GetMiss(); + } else { + throw new InternalServerError("CacheService returned an unexpected result: $result"); + } } catch (SdkError $e) { return new GetError($e); } catch (Exception $e) { @@ -800,7 +801,7 @@ public function dictionaryGetFields(string $cacheName, string $dictionaryName, a return new DictionaryGetFieldsError(new UnknownError($e->getMessage(), 0, $e)); } if ($dictionaryGetFieldsResponse->hasFound()) { - return new DictionaryGetFieldsHit($dictionaryGetFieldsResponse, fields: $fields); + return new DictionaryGetFieldsHit($dictionaryGetFieldsResponse, $fields); } return new DictionaryGetFieldsMiss(); @@ -1076,7 +1077,7 @@ public function setRemoveElement(string $cacheName, string $setName, string $ele } catch (Exception $e) { return ResponseFuture::createResolved(new SetRemoveElementError(new UnknownError($e->getMessage()))); } - + return ResponseFuture::createPending( function () use ($call): SetRemoveElementResponse { try { diff --git a/src/Cache/Psr16CacheClient.php b/src/Cache/Psr16CacheClient.php index 2e54e074..e7ae78b6 100644 --- a/src/Cache/Psr16CacheClient.php +++ b/src/Cache/Psr16CacheClient.php @@ -96,7 +96,7 @@ private function handleCacheError(ResponseBase $err): void * @param bool $clear_error * @return CacheException|null */ - public function getLastError(bool $clear_error = true): CacheException|null + public function getLastError(bool $clear_error = true): ?CacheException { if (!$this->throwExceptions) { return null; @@ -111,7 +111,7 @@ public function getLastError(bool $clear_error = true): CacheException|null /** * @inheritDoc */ - public function get(string $key, mixed $default = null): mixed + public function get($key, $default = null) { validatePsr16Key($key); $response = $this->momento->get($this->cacheName, $key); @@ -128,7 +128,7 @@ public function get(string $key, mixed $default = null): mixed /** * @inheritDoc */ - public function set(string $key, mixed $value, DateInterval|int|null $ttl = null): bool + public function set($key, $value, $ttl = null): bool { validatePsr16Key($key); if (is_null($ttl)) { @@ -154,7 +154,7 @@ public function set(string $key, mixed $value, DateInterval|int|null $ttl = null /** * @inheritDoc */ - public function delete(string $key): bool + public function delete($key): bool { validatePsr16Key($key); $response = $this->momento->delete($this->cacheName, $key); @@ -178,7 +178,7 @@ public function clear(): bool /** * @inheritDoc */ - public function getMultiple(iterable $keys, mixed $default = null): iterable + public function getMultiple($keys, $default = null): iterable { $keyList = []; @@ -216,7 +216,7 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable /** * @inheritDoc */ - public function setMultiple(iterable $values, DateInterval|int|null $ttl = null): bool + public function setMultiple($values, $ttl = null): bool { $keyValueMap = []; @@ -258,7 +258,7 @@ public function setMultiple(iterable $values, DateInterval|int|null $ttl = null) /** * @inheritDoc */ - public function deleteMultiple(iterable $keys): bool + public function deleteMultiple($keys): bool { $keyList = []; @@ -290,7 +290,7 @@ public function deleteMultiple(iterable $keys): bool /** * @inheritDoc */ - public function has(string $key): bool + public function has($key): bool { validatePsr16Key($key); return (bool)$this->get($key); diff --git a/src/Config/Transport/StaticGrpcConfiguration.php b/src/Config/Transport/StaticGrpcConfiguration.php index dc1d5598..a51b775c 100644 --- a/src/Config/Transport/StaticGrpcConfiguration.php +++ b/src/Config/Transport/StaticGrpcConfiguration.php @@ -17,7 +17,7 @@ public function __construct(?int $deadlineMilliseconds = null, bool $forceNewCha $this->numGrpcChannels = $numGrpcChannels; } - public function getDeadlineMilliseconds(): int|null + public function getDeadlineMilliseconds(): ?int { return $this->deadlineMilliseconds; } @@ -27,7 +27,7 @@ public function withDeadlineMilliseconds(int $deadlineMilliseconds): StaticGrpcC return new StaticGrpcConfiguration($deadlineMilliseconds, $this->forceNewChannel, $this->numGrpcChannels); } - public function getForceNewChannel(): bool|null + public function getForceNewChannel(): ?bool { return $this->forceNewChannel; } diff --git a/src/Config/Transport/StaticTransportStrategy.php b/src/Config/Transport/StaticTransportStrategy.php index 8b6c877b..4c4c5807 100644 --- a/src/Config/Transport/StaticTransportStrategy.php +++ b/src/Config/Transport/StaticTransportStrategy.php @@ -14,7 +14,7 @@ class StaticTransportStrategy implements ITransportStrategy public function __construct( IGrpcConfiguration $grpcConfig, ?ILoggerFactory $loggerFactory = null, - ?int $maxIdleMillis = null, + ?int $maxIdleMillis = null ) { $this->grpcConfig = $grpcConfig; @@ -22,7 +22,7 @@ public function __construct( $this->maxIdleMillis = $maxIdleMillis; } - public function getGrpcConfig(): IGrpcConfiguration|null + public function getGrpcConfig(): ?IGrpcConfiguration { return $this->grpcConfig; } diff --git a/src/Logging/LoggerFactoryBase.php b/src/Logging/LoggerFactoryBase.php index 1bffc771..a7bea32f 100644 --- a/src/Logging/LoggerFactoryBase.php +++ b/src/Logging/LoggerFactoryBase.php @@ -7,7 +7,7 @@ abstract class LoggerFactoryBase implements ILoggerFactory { protected string $logLevel; - public function getLogLevel(): string|null + public function getLogLevel(): ?string { return $this->logLevel; } diff --git a/src/Logging/StderrLogger.php b/src/Logging/StderrLogger.php index b5f5e6e7..f4f943cd 100644 --- a/src/Logging/StderrLogger.php +++ b/src/Logging/StderrLogger.php @@ -48,7 +48,13 @@ private function interpolate(string $message, array $context = []): string return strtr($message, $replace); } - public function log($level, \Stringable|string $message, array $context = []): void + /** + * @param $level + * @param \Stringable|string $message + * @param array $context + * @return void + */ + public function log($level, $message, array $context = []): void { if (!$this->shouldLog($level, $this->logLevel)) { return; @@ -56,7 +62,7 @@ public function log($level, \Stringable|string $message, array $context = []): v if (!empty($context)) { $message = $this->interpolate($message, $context); } - if (!str_ends_with("$message", "\n")) { + if (substr($message, strlen($message) - 1, 1) != "\n") { $message = "$message\n"; } if ($this->name) { diff --git a/src/Requests/CollectionTtl.php b/src/Requests/CollectionTtl.php index 850d8660..378ce281 100644 --- a/src/Requests/CollectionTtl.php +++ b/src/Requests/CollectionTtl.php @@ -61,7 +61,7 @@ public static function of(int $ttlSeconds): CollectionTtl /** * @return int|null The current value for TTL in seconds. */ - public function getTtl(): int|null + public function getTtl(): ?int { return $this->ttlSeconds; } @@ -69,7 +69,7 @@ public function getTtl(): int|null /** * @return bool|null The current value for whether or not to refresh the TTL for a collection when it is modified. */ - public function getRefreshTtl(): bool|null + public function getRefreshTtl(): ?bool { return $this->refreshTtl; } diff --git a/tests/Cache/CacheClientTest.php b/tests/Cache/CacheClientTest.php index c3fb0dd3..ca004eb3 100644 --- a/tests/Cache/CacheClientTest.php +++ b/tests/Cache/CacheClientTest.php @@ -683,7 +683,7 @@ public function testListPushFrontFetchHappyPath() $listName = uniqid(); $value = uniqid(); $value2 = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(6000)); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(6000)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(1, $response->asSuccess()->listLength()); @@ -696,7 +696,7 @@ public function testListPushFrontFetchHappyPath() $this->assertCount(1, $values); $this->assertContains($value, $values); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value2, ttl: CollectionTtl::of(6000)); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value2, null, CollectionTtl::of(6000)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(2, $response->asSuccess()->listLength()); @@ -713,11 +713,11 @@ public function testListPushFront_NoRefreshTtl() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -731,11 +731,11 @@ public function testListPushFront_RefreshTtl() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(10)->withRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(10)->withRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -752,15 +752,15 @@ public function testListPushFront_TruncateList() $value1 = uniqid(); $value2 = uniqid(); $value3 = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value1, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value1, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value2, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value2, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value3, 2, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value3, 2, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -774,7 +774,7 @@ public function testListPushFront_TruncateList_NegativeValue() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, -1, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, -1, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNotNull($response->asError(), "Expected error but got: $response"); $this->assertEquals(MomentoErrorCode::INVALID_ARGUMENT_ERROR, $response->asError()->errorCode()); } @@ -784,7 +784,7 @@ public function testListPushBackFetchHappyPath() $listName = uniqid(); $value = uniqid(); $value2 = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(6000)); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(6000)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(1, $response->asSuccess()->listLength()); @@ -797,7 +797,7 @@ public function testListPushBackFetchHappyPath() $this->assertCount(1, $values); $this->assertContains($value, $values); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value2, ttl: CollectionTtl::of(6000)); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value2, null, CollectionTtl::of(6000)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(2, $response->asSuccess()->listLength()); @@ -814,11 +814,11 @@ public function testListPushBack_NoRefreshTtl() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -832,11 +832,11 @@ public function testListPushBack_RefreshTtl() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::of(10)); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::of(10)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -853,15 +853,15 @@ public function testListPushBack_TruncateList() $value1 = uniqid(); $value2 = uniqid(); $value3 = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value1, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value1, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value2, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value2, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value3, 2, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value3, 2, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -875,7 +875,7 @@ public function testListPushBack_TruncateList_NegativeValue() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, -1, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, -1, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNotNull($response->asError(), "Expected error but got: $response"); $this->assertEquals(MomentoErrorCode::INVALID_ARGUMENT_ERROR, $response->asError()->errorCode()); } @@ -894,7 +894,7 @@ public function testListPopFront_HappyPath() $values = []; foreach (range(0, 3) as $ignored) { $val = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $val, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); array_unshift($values, $val); @@ -924,7 +924,7 @@ public function testListPopFront_EmptyList() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -949,7 +949,7 @@ public function testListPopBack_HappyPath() $values = []; foreach (range(0, 3) as $ignored) { $val = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $values[] = $val; @@ -972,7 +972,7 @@ public function testListPopBack_EmptyList() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -998,16 +998,16 @@ public function testListRemoveValue_HappyPath() $valueToRemove = uniqid(); foreach (range(0, 3) as $ignored) { $val = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $values[] = $val; } - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $valueToRemove, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $valueToRemove, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $valueToRemove, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $valueToRemove, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -1034,7 +1034,7 @@ public function testListRemoveValues_ValueNotPresent() $values = []; foreach (range(0, 3) as $ignored) { $val = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $values[] = $val; @@ -1060,7 +1060,7 @@ public function testListLength_HappyPath() $listName = uniqid(); foreach (range(0, 3) as $i) { $val = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $val, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -1162,7 +1162,7 @@ public function testDictionaryEmptyValue_IsError() $dictionaryName = uniqid(); $field = uniqid(); $value = ""; - $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNotNull($response->asError(), "Expected error but got: $response"); $this->assertEquals(MomentoErrorCode::INVALID_ARGUMENT_ERROR, $response->asError()->errorCode()); } @@ -1172,11 +1172,11 @@ public function testDictionaryRefreshTtl() $dictionaryName = uniqid(); $field = uniqid(); $value = uniqid(); - $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, ttl: CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, ttl: CollectionTtl::of(10)); + $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, $value, CollectionTtl::of(10)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -1191,7 +1191,7 @@ public function testDictionaryDelete_HappyPath() { $dictionaryName = uniqid(); $field = uniqid(); - $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, uniqid(), ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, uniqid(), CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); @@ -1211,7 +1211,7 @@ public function testDictionaryIncrement_NullFieldError() { $dictionaryName = uniqid(); $field = ""; - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNotNull($response->asError(), "Expected error but got: $response"); $this->assertEquals(MomentoErrorCode::INVALID_ARGUMENT_ERROR, $response->asError()->errorCode()); } @@ -1220,17 +1220,17 @@ public function testDictionaryIncrement_HappyPath() { $dictionaryName = uniqid(); $field = uniqid(); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(1, $response->asSuccess()->valueInt()); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 41, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 41, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(42, $response->asSuccess()->valueInt()); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: -1042, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, -1042, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(-1000, $response->asSuccess()->valueInt()); @@ -1245,11 +1245,11 @@ public function testDictionaryIncrement_RefreshTtl() { $dictionaryName = uniqid(); $field = uniqid(); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::of(2)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::of(10)); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::of(10)); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); sleep(2); @@ -1264,11 +1264,11 @@ public function testDictionaryIncrement_NoRefreshTtl() { $dictionaryName = uniqid(); $field = uniqid(); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::of(5)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::of(10)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); sleep(6); @@ -1286,12 +1286,12 @@ public function testDictionaryIncrement_SetAndReset() $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 0, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 0, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(10, $response->asSuccess()->valueInt()); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 90, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 90, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(100, $response->asSuccess()->valueInt()); @@ -1300,7 +1300,7 @@ public function testDictionaryIncrement_SetAndReset() $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 0, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 0, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); $this->assertEquals(0, $response->asSuccess()->valueInt()); @@ -1314,7 +1314,7 @@ public function testDictionaryIncrement_FailedPrecondition() $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 1); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1); $this->assertNotNull($response->asError(), "Expected an error but got: $response"); $this->assertEquals(MomentoErrorCode::FAILED_PRECONDITION_ERROR, $response->asError()->errorCode()); } @@ -1774,7 +1774,7 @@ public function testCacheListPopFrontToString_HappyPath() { $listName = uniqid(); $value = "a short value"; - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listPopFront($this->TEST_CACHE_NAME, $listName); @@ -1786,7 +1786,7 @@ public function testCacheListPopFrontToString_LongValue() { $listName = uniqid(); $value = str_repeat("a", 256); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listPopFront($this->TEST_CACHE_NAME, $listName); @@ -1799,7 +1799,7 @@ public function testCacheListPopBackToString_HappyPath() { $listName = uniqid(); $value = "a short value"; - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listPopBack($this->TEST_CACHE_NAME, $listName); @@ -1811,7 +1811,7 @@ public function testCacheListPopBackToString_LongValue() { $listName = uniqid(); $value = str_repeat("a", 256); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listPopBack($this->TEST_CACHE_NAME, $listName); @@ -1824,11 +1824,11 @@ public function testCacheListFetchToString_HappyPath() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listFetch($this->TEST_CACHE_NAME, $listName); @@ -1841,13 +1841,13 @@ public function testCacheListPushFrontToString_HappyPath() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 1 items"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 2 items"); - $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl(2)->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushFront($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl(2)->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 3 items"); } @@ -1856,13 +1856,13 @@ public function testCacheListPushBackToString_HappyPath() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 1 items"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 2 items"); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 3 items"); } @@ -1871,11 +1871,11 @@ public function testCacheListLengthToString_HappyPath() { $listName = uniqid(); $value = uniqid(); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); - $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->listPushBack($this->TEST_CACHE_NAME, $listName, $value, null, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $response = $this->client->listLength($this->TEST_CACHE_NAME, $listName); @@ -1934,11 +1934,11 @@ public function testDictionaryIncrementToString_HappyPath() $response = $this->client->dictionarySetField($this->TEST_CACHE_NAME, $dictionaryName, $field, "1", CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 1, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 2"); - $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, amount: 10, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->dictionaryIncrement($this->TEST_CACHE_NAME, $dictionaryName, $field, 10, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertEquals("$response", get_class($response) . ": 12"); } @@ -2081,7 +2081,7 @@ public function testSetLength_HappyPath() $setName = uniqid(); foreach (range(0, 3) as $i) { $val = uniqid(); - $response = $this->client->setAddElement($this->TEST_CACHE_NAME, $setName, $val, ttl: CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); + $response = $this->client->setAddElement($this->TEST_CACHE_NAME, $setName, $val, CollectionTtl::fromCacheTtl()->withNoRefreshTtlOnUpdates()); $this->assertNull($response->asError()); $this->assertNotNull($response->asSuccess(), "Expected a success but got: $response"); diff --git a/tests/Cache/Psr16ClientTest.php b/tests/Cache/Psr16ClientTest.php index ac7816ed..ca5e2d26 100644 --- a/tests/Cache/Psr16ClientTest.php +++ b/tests/Cache/Psr16ClientTest.php @@ -100,7 +100,7 @@ public function testOverrideDefaultCacheName() $configuration, $authProvider, $this->DEFAULT_TTL_SECONDS ); $psrClient = new Psr16CacheClient( - $configuration, $authProvider, $this->DEFAULT_TTL_SECONDS, cacheName: $testCacheName + $configuration, $authProvider, $this->DEFAULT_TTL_SECONDS, null, $testCacheName ); $listResponse = $client->listCaches(); $this->assertNull($listResponse->asError()); @@ -120,7 +120,7 @@ public function testOverrideDefaultCacheName() /** * @dataProvider dataTypeProvider */ - public function testGetSetDelete_HappyPath_MultipleTypes(mixed $value) + public function testGetSetDelete_HappyPath_MultipleTypes($value) { $key = "myKey";