diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e671bd02..c45918692 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,7 @@ jobs: name: Check code styles command: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix -v --dry-run - # Run tests with phpunit + # Run tests with phpunit # # If the PR is open by an Algolia, we run all the tests # with the keys in the env variables @@ -110,6 +110,10 @@ jobs: workflows: workflow: jobs: + - test: + name: 'Guzzle 7 - PHP 8.4' + version: "8.4" + http_client: guzzlehttp/guzzle:"^7.0" - test: name: 'Guzzle 7 - PHP 8.1' version: "8.1" diff --git a/src/Cache/FileCacheDriver.php b/src/Cache/FileCacheDriver.php index 4e4173f1c..c4e1a51bb 100644 --- a/src/Cache/FileCacheDriver.php +++ b/src/Cache/FileCacheDriver.php @@ -18,7 +18,7 @@ public function __construct($directory) /** * {@inheritdoc} */ - public function get($key, $default = null) + public function get($key, $default = null): mixed { if (!$this->has($key)) { return $default; @@ -30,15 +30,15 @@ public function get($key, $default = null) /** * {@inheritdoc} */ - public function set($key, $value, $ttl = null) + public function set($key, $value, $ttl = null): bool { - return file_put_contents($this->getFilenameFromKey($key), $value); + return file_put_contents($this->getFilenameFromKey($key), $value) !== false; } /** * {@inheritdoc} */ - public function delete($key) + public function delete($key): bool { return @unlink($this->getFilenameFromKey($key)); } @@ -46,7 +46,7 @@ public function delete($key) /** * {@inheritdoc} */ - public function clear() + public function clear(): bool { $result = true; foreach (glob($this->directory.self::PREFIX.'*') as $file) { @@ -59,7 +59,7 @@ public function clear() /** * {@inheritdoc} */ - public function getMultiple($keys, $default = null) + public function getMultiple($keys, $default = null): iterable { $result = []; foreach ($keys as $key) { @@ -72,7 +72,7 @@ public function getMultiple($keys, $default = null) /** * {@inheritdoc} */ - public function setMultiple($values, $ttl = null) + public function setMultiple($values, $ttl = null): bool { $result = true; foreach ($values as $key => $value) { @@ -85,7 +85,7 @@ public function setMultiple($values, $ttl = null) /** * {@inheritdoc} */ - public function deleteMultiple($keys) + public function deleteMultiple($keys): bool { $result = true; foreach ($keys as $key) { @@ -98,7 +98,7 @@ public function deleteMultiple($keys) /** * {@inheritdoc} */ - public function has($key) + public function has($key): bool { return file_exists($this->getFilenameFromKey($key)); } diff --git a/src/Cache/NullCacheDriver.php b/src/Cache/NullCacheDriver.php index 0eb1d6d3a..c0ad7ed7a 100644 --- a/src/Cache/NullCacheDriver.php +++ b/src/Cache/NullCacheDriver.php @@ -9,7 +9,7 @@ final class NullCacheDriver implements CacheInterface /** * {@inheritdoc} */ - public function get($key, $default = null) + public function get($key, $default = null): mixed { return $default; } @@ -17,7 +17,7 @@ public function get($key, $default = null) /** * {@inheritdoc} */ - public function set($key, $value, $ttl = null) + public function set($key, $value, $ttl = null): bool { return true; } @@ -25,7 +25,7 @@ public function set($key, $value, $ttl = null) /** * {@inheritdoc} */ - public function delete($key) + public function delete($key): bool { return true; } @@ -33,7 +33,7 @@ public function delete($key) /** * {@inheritdoc} */ - public function clear() + public function clear(): bool { return true; } @@ -41,7 +41,7 @@ public function clear() /** * {@inheritdoc} */ - public function getMultiple($keys, $default = null) + public function getMultiple($keys, $default = null): iterable { $return = []; @@ -55,7 +55,7 @@ public function getMultiple($keys, $default = null) /** * {@inheritdoc} */ - public function setMultiple($values, $ttl = null) + public function setMultiple($values, $ttl = null): bool { return true; } @@ -63,7 +63,7 @@ public function setMultiple($values, $ttl = null) /** * {@inheritdoc} */ - public function deleteMultiple($keys) + public function deleteMultiple($keys): bool { return true; } @@ -71,7 +71,7 @@ public function deleteMultiple($keys) /** * {@inheritdoc} */ - public function has($key) + public function has($key): bool { return false; }