From e4efb99791c5f89dec61fd1e77fff41feadd15af Mon Sep 17 00:00:00 2001 From: breno Date: Tue, 12 Sep 2023 09:40:15 -0400 Subject: [PATCH] php82 --- .github/workflows/ci.yml | 4 ++-- composer.json | 4 ++-- tests/Stubs/Psr16ArrayCache.php | 29 ++++++++++++++++++++--------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a2e73d..07b5720 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: matrix: # windows-latest, macOS-latest? operating-system: [ubuntu-latest] - php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + php-versions: ['7.4', '8.0', '8.1', '8.2'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: @@ -53,7 +53,7 @@ jobs: - name: Setup PHP (with Xdebug) uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: xdebug - name: Check PHP Version diff --git a/composer.json b/composer.json index 0a218c6..c9884a8 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,8 @@ } ], "require": { - "php": ">=7.0", - "psr/simple-cache": "1.*" + "php": ">=7.4", + "psr/simple-cache": "3.*" }, "require-dev": { "phpunit/phpunit": "^6 || ^9", diff --git a/tests/Stubs/Psr16ArrayCache.php b/tests/Stubs/Psr16ArrayCache.php index e5def8d..b1a532b 100644 --- a/tests/Stubs/Psr16ArrayCache.php +++ b/tests/Stubs/Psr16ArrayCache.php @@ -5,58 +5,69 @@ use Psr\SimpleCache\CacheInterface; use Psr\SimpleCache\InvalidArgumentException; +use function PHPUnit\Framework\exactly; class Psr16ArrayCache implements CacheInterface { protected $cached = []; - public function get($key, $default = null) + public function get($key, $default = null): mixed { if (!$this->has($key)) { - throw new class implements InvalidArgumentException { + throw new class extends \Exception implements InvalidArgumentException { }; } return $this->cached[$key]; } - public function set($key, $value, $ttl = null) + public function set($key, $value, $ttl = null): bool { $this->cached[$key] = $value; + + return true; } - public function delete($key) + public function delete($key): bool { unset($this->cached[$key]); + + return true; } - public function clear() + public function clear(): bool { $this->cached = []; + + return true; } - public function getMultiple($keys, $default = null) + public function getMultiple($keys, $default = null): iterable { foreach ($keys as $key) { yield $this->get($key); } } - public function setMultiple($values, $ttl = null) + public function setMultiple($values, $ttl = null): bool { foreach ($values as $key => $value) { $this->set($key, $value, $ttl); } + + return true; } - public function deleteMultiple($keys) + public function deleteMultiple($keys): bool { foreach ($keys as $key) { $this->delete($key); } + + return true; } - public function has($key) + public function has($key): bool { return array_key_exists($key, $this->cached); }