From 1deb56d2e33a46b8d775fa681337c5904cec666a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Dec 2022 13:11:24 +0000 Subject: [PATCH 1/7] Update dependency vimeo/psalm to v5 | datasource | package | from | to | | ---------- | ----------- | ------ | ----- | | packagist | vimeo/psalm | 4.30.0 | 5.2.0 | Signed-off-by: Renovate Bot Signed-off-by: Gary Lockett --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9a76628..6da4760 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "laminas/laminas-coding-standard": "~2.4.0", "laminas/laminas-serializer": "^2.13.0", "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "vimeo/psalm": "^5.0.0" }, "config": { "sort-packages": true, From 609f2c490bd368ab4741e04c5062de851989212c Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sat, 10 Dec 2022 13:01:48 +0000 Subject: [PATCH 2/7] add PHP 8.2 support, drop PHP 7.4 Signed-off-by: Gary Lockett --- composer.json | 8 +- composer.lock | 576 +++++++++++++++++++-------------------------- psalm-baseline.xml | 37 +-- 3 files changed, 255 insertions(+), 366 deletions(-) diff --git a/composer.json b/composer.json index 6da4760..c7d66b9 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "license": "BSD-3-Clause", "require": { - "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "ext-redis": "^4.3 || ^5.0.2", "laminas/laminas-cache": "^3.0" }, @@ -20,13 +20,13 @@ "laminas/laminas-cache-storage-adapter-test": "^2.3", "laminas/laminas-coding-standard": "~2.4.0", "laminas/laminas-serializer": "^2.13.0", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^5.0.0" + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.1.0" }, "config": { "sort-packages": true, "platform": { - "php": "7.4.99" + "php": "8.0.99" }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true diff --git a/composer.lock b/composer.lock index 84b4b4e..ed23a2f 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": "a49f0c59e8c0ec96f02ad233f510c419", + "content-hash": "ec4e7e68ec11df02975089429a1d43c8", "packages": [ { "name": "laminas/laminas-cache", - "version": "3.6.0", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-cache.git", - "reference": "4929dea8c0d5468701fa5073cd6ef7efe5ff0043" + "reference": "e3bdbd056da4ceb1a41d66a8f6aee4a7bcce9b47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/4929dea8c0d5468701fa5073cd6ef7efe5ff0043", - "reference": "4929dea8c0d5468701fa5073cd6ef7efe5ff0043", + "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/e3bdbd056da4ceb1a41d66a8f6aee4a7bcce9b47", + "reference": "e3bdbd056da4ceb1a41d66a8f6aee4a7bcce9b47", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "laminas/laminas-eventmanager": "^3.4", "laminas/laminas-servicemanager": "^3.11.1", "laminas/laminas-stdlib": "^3.6", - "php": "~7.4.0 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/cache": "^1.0", "psr/simple-cache": "^1.0", "stella-maris/clock": "^0.1.5", @@ -51,8 +51,8 @@ "laminas/laminas-serializer": "^2.6.1", "phpbench/phpbench": "^1.0", "phpunit/phpunit": "^9.5.23", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24" + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0" }, "suggest": { "laminas/laminas-cache-storage-adapter-apcu": "APCu implementation", @@ -104,36 +104,37 @@ "type": "community_bridge" } ], - "time": "2022-09-19T21:06:59+00:00" + "time": "2022-12-05T14:38:48+00:00" }, { "name": "laminas/laminas-eventmanager", - "version": "3.5.0", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-eventmanager.git", - "reference": "41f7209428f37cab9573365e361f4078209aaafa" + "reference": "74c091fb0da37744e7d215ef5bd3564c77f6385e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/41f7209428f37cab9573365e361f4078209aaafa", - "reference": "41f7209428f37cab9573365e361f4078209aaafa", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/74c091fb0da37744e7d215ef5bd3564c77f6385e", + "reference": "74c091fb0da37744e7d215ef5bd3564c77f6385e", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "container-interop/container-interop": "<1.2", "zendframework/zend-eventmanager": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.2.1", - "laminas/laminas-stdlib": "^3.6", - "phpbench/phpbench": "^1.1", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5.5", - "psr/container": "^1.1.2 || ^2.0.2" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-stdlib": "^3.15", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "psr/container": "^1.1.2 || ^2.0.2", + "vimeo/psalm": "^5.0.0" }, "suggest": { "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature", @@ -171,25 +172,25 @@ "type": "community_bridge" } ], - "time": "2022-04-06T21:05:17+00:00" + "time": "2022-12-10T16:36:52+00:00" }, { "name": "laminas/laminas-servicemanager", - "version": "3.17.0", + "version": "3.20.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "360be5f16955dd1edbcce1cfaa98ed82a17f02ec" + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/360be5f16955dd1edbcce1cfaa98ed82a17f02ec", - "reference": "360be5f16955dd1edbcce1cfaa98ed82a17f02ec", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", "shasum": "" }, "require": { "laminas/laminas-stdlib": "^3.2.1", - "php": "~7.4.0 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/container": "^1.0" }, "conflict": { @@ -205,17 +206,16 @@ "container-interop/container-interop": "^1.2.0" }, "require-dev": { - "composer/package-versions-deprecated": "^1.0", + "composer/package-versions-deprecated": "^1.11.99.5", "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-container-config-test": "^0.7", - "laminas/laminas-dependency-plugin": "^2.1.2", - "mikey179/vfsstream": "^1.6.10@alpha", - "ocramius/proxy-manager": "^2.11", - "phpbench/phpbench": "^1.1", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5.5", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.8" + "laminas/laminas-container-config-test": "^0.8", + "laminas/laminas-dependency-plugin": "^2.2", + "mikey179/vfsstream": "^1.6.11@alpha", + "ocramius/proxy-manager": "^2.14.1", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "suggest": { "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" @@ -262,35 +262,34 @@ "type": "community_bridge" } ], - "time": "2022-09-22T11:33:46+00:00" + "time": "2022-12-01T17:03:38+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.13.0", + "version": "3.16.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76" + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/66a6d03c381f6c9f1dd988bf8244f9afb9380d76", - "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/f4f773641807c7ccee59b758bfe4ac4ba33ecb17", + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-stdlib": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "phpbench/phpbench": "^1.2.6", - "phpstan/phpdoc-parser": "^0.5.4", - "phpunit/phpunit": "^9.5.23", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.26" + "laminas/laminas-coding-standard": "^2.4.0", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "type": "library", "autoload": { @@ -322,7 +321,7 @@ "type": "community_bridge" } ], - "time": "2022-08-24T13:56:50+00:00" + "time": "2022-12-03T18:48:01+00:00" }, { "name": "psr/cache", @@ -1622,6 +1621,67 @@ }, "time": "2022-03-02T22:36:06+00:00" }, + { + "name": "fidry/cpu-core-counter", + "version": "0.4.1", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-16T22:01:02+00:00" + }, { "name": "laminas/laminas-cache-storage-adapter-benchmark", "version": "1.2.0", @@ -1793,28 +1853,28 @@ }, { "name": "laminas/laminas-json", - "version": "3.3.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-json.git", - "reference": "9a0ce9f330b7d11e70c4acb44d67e8c4f03f437f" + "reference": "7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-json/zipball/9a0ce9f330b7d11e70c4acb44d67e8c4f03f437f", - "reference": "9a0ce9f330b7d11e70c4acb44d67e8c4f03f437f", + "url": "https://api.github.com/repos/laminas/laminas-json/zipball/7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec", + "reference": "7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-json": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.2.1", + "laminas/laminas-coding-standard": "~2.4.0", "laminas/laminas-stdlib": "^2.7.7 || ^3.1", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5.25" }, "suggest": { "laminas/laminas-json-server": "For implementing JSON-RPC servers", @@ -1850,35 +1910,35 @@ "type": "community_bridge" } ], - "time": "2021-09-02T18:02:31+00:00" + "time": "2022-10-17T04:06:45+00:00" }, { "name": "laminas/laminas-serializer", - "version": "2.13.0", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-serializer.git", - "reference": "aa72a694d79f01ef1252b276ca9930158c3b877d" + "reference": "c4ceeb080f8d080006616072d2926949b3e5b9ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-serializer/zipball/aa72a694d79f01ef1252b276ca9930158c3b877d", - "reference": "aa72a694d79f01ef1252b276ca9930158c3b877d", + "url": "https://api.github.com/repos/laminas/laminas-serializer/zipball/c4ceeb080f8d080006616072d2926949b3e5b9ea", + "reference": "c4ceeb080f8d080006616072d2926949b3e5b9ea", "shasum": "" }, "require": { "laminas/laminas-json": "^3.1", "laminas/laminas-stdlib": "^3.2", - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-serializer": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-math": "^3.3", - "laminas/laminas-servicemanager": "^3.6", - "phpunit/phpunit": "^9.3" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-math": "~3.6.0", + "laminas/laminas-servicemanager": "~3.19.0", + "phpunit/phpunit": "~9.5.25" }, "suggest": { "laminas/laminas-math": "(^3.3) To support Python Pickle serialization", @@ -1920,7 +1980,7 @@ "type": "community_bridge" } ], - "time": "2022-04-11T19:50:04+00:00" + "time": "2022-10-16T14:51:10+00:00" }, { "name": "myclabs/deep-copy", @@ -3075,16 +3135,16 @@ }, { "name": "psalm/plugin-phpunit", - "version": "0.17.0", + "version": "0.18.4", "source": { "type": "git", "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "45951541beef07e93e3ad197daf01da88e85c31d" + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/45951541beef07e93e3ad197daf01da88e85c31d", - "reference": "45951541beef07e93e3ad197daf01da88e85c31d", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", "shasum": "" }, "require": { @@ -3092,7 +3152,7 @@ "composer/semver": "^1.4 || ^2.0 || ^3.0", "ext-simplexml": "*", "php": "^7.1 || ^8.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.5" + "vimeo/psalm": "dev-master || dev-4.x || ^4.7.1 || ^5@beta || ^5.0" }, "conflict": { "phpunit/phpunit": "<7.5" @@ -3129,36 +3189,36 @@ "description": "Psalm plugin for PHPUnit", "support": { "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.17.0" + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.4" }, - "time": "2022-06-14T17:05:57+00:00" + "time": "2022-12-03T07:47:07+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3179,9 +3239,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "sebastian/cli-parser", @@ -4330,46 +4390,42 @@ }, { "name": "symfony/console", - "version": "v5.4.16", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" + "reference": "be294423f337dda97c810733138c0caec1bb0575" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "url": "https://api.github.com/repos/symfony/console/zipball/be294423f337dda97c810733138c0caec1bb0575", + "reference": "be294423f337dda97c810733138c0caec1bb0575", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -4409,7 +4465,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.16" + "source": "https://github.com/symfony/console/tree/v6.0.16" }, "funding": [ { @@ -4425,29 +4481,29 @@ "type": "tidelift" } ], - "time": "2022-11-25T14:09:27+00:00" + "time": "2022-11-25T18:58:46+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -4476,7 +4532,7 @@ "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" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { @@ -4492,27 +4548,26 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.13", + "version": "v6.0.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + "reference": "3adca49133bd055ebe6011ed1e012be3c908af79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3adca49133bd055ebe6011ed1e012be3c908af79", + "reference": "3adca49133bd055ebe6011ed1e012be3c908af79", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -4540,7 +4595,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + "source": "https://github.com/symfony/filesystem/tree/v6.0.13" }, "funding": [ { @@ -4556,26 +4611,24 @@ "type": "tidelift" } ], - "time": "2022-09-21T19:53:16+00:00" + "time": "2022-09-21T20:25:27+00:00" }, { "name": "symfony/finder", - "version": "v5.4.11", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "url": "https://api.github.com/repos/symfony/finder/zipball/09cb683ba5720385ea6966e5e06be2a34f2568b1", + "reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -4603,7 +4656,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" + "source": "https://github.com/symfony/finder/tree/v6.0.11" }, "funding": [ { @@ -4619,27 +4672,25 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2022-07-29T07:39:48+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.11", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { @@ -4672,7 +4723,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" }, "funding": [ { @@ -4688,7 +4739,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5020,85 +5071,6 @@ ], "time": "2022-11-03T14:55:06+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.27.0", @@ -5184,21 +5156,20 @@ }, { "name": "symfony/process", - "version": "v5.4.11", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + "reference": "44270a08ccb664143dede554ff1c00aaa2247a43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", + "url": "https://api.github.com/repos/symfony/process/zipball/44270a08ccb664143dede554ff1c00aaa2247a43", + "reference": "44270a08ccb664143dede554ff1c00aaa2247a43", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -5226,7 +5197,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.11" + "source": "https://github.com/symfony/process/tree/v6.0.11" }, "funding": [ { @@ -5242,7 +5213,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2022-06-27T17:10:44+00:00" }, { "name": "symfony/service-contracts", @@ -5329,34 +5300,33 @@ }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v6.0.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "51ac0fa0ccf132a00519b87c97e8f775fa14e771" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/51ac0fa0ccf132a00519b87c97e8f775fa14e771", + "reference": "51ac0fa0ccf132a00519b87c97e8f775fa14e771", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -5395,7 +5365,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v6.0.15" }, "funding": [ { @@ -5411,7 +5381,7 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2022-10-10T09:34:08+00:00" }, { "name": "theseer/tokenizer", @@ -5465,24 +5435,24 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -5491,35 +5461,35 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", + "fidry/cpu-core-counter": "^0.4.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -5535,17 +5505,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -5567,9 +5534,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm/tree/5.2.0" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2022-12-12T08:18:56+00:00" }, { "name": "webimpress/coding-standard", @@ -5674,57 +5641,6 @@ "source": "https://github.com/webmozarts/glob/tree/4.6.0" }, "time": "2022-05-24T19:45:58+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -5733,12 +5649,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "ext-redis": "^4.3 || ^5.0.2" }, "platform-dev": [], "platform-overrides": { - "php": "7.4.99" + "php": "8.0.99" }, "plugin-api-version": "2.3.0" } diff --git a/psalm-baseline.xml b/psalm-baseline.xml index eeba31a..4efa208 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $ttl @@ -26,9 +26,6 @@ parent::setOptions($options) - - $value - $this->preSerialize($value) $this->preSerialize($value) @@ -76,9 +73,6 @@ Redis - - $info - $info @@ -117,28 +111,17 @@ normalizePersistentId normalizeServer - + $k $key $resource $resource - $resource['database'] $resource['lib_options'] $resource['persistent_id'] - $resource['persistent_id'] $resource['server'] $server - $server['host'] - $server['host'] - $server['host'] - $server['host'] - $server['port'] - $server['port'] - $server['timeout'] - $server['timeout'] - $server['timeout'] - + $resource['database'] $resource['initialized'] $resource['initialized'] @@ -161,7 +144,6 @@ $resource['resource'] $resource['resource'] $resource['server'] - $resource['version'] $server['host'] $server['host'] $server['host'] @@ -176,17 +158,14 @@ $this->resources[$resourceId]['version'] $this->resources[$resourceId]['version'] - + $resource['database'] $resource['initialized'] $resource['lib_options'] $resource['password'] $resource['password'] $resource['persistent_id'] - $resource['resource'] $resource['server'] - $resource['version'] - $this->resources[$id]['resource'] $libOptions[$constValue] @@ -239,19 +218,13 @@ null null - + $this->storage $this->storage - - $redis->info() - $redis->info() - - $redis->socket - From 9bccc46aadc6566a01ee1cf1dbdcfff863bbbe3a Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sat, 10 Dec 2022 13:32:25 +0000 Subject: [PATCH 3/7] update vimeo/psalm to v5 Signed-off-by: Gary Lockett --- composer.json | 128 ++++++++++++------------ psalm-baseline.xml | 22 ++-- src/Exception/RedisRuntimeException.php | 2 +- src/Redis.php | 7 +- src/RedisCluster.php | 8 +- src/RedisClusterOptions.php | 5 +- src/RedisResourceManager.php | 11 +- test/integration/Laminas/RedisTest.php | 18 ++-- 8 files changed, 98 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index c7d66b9..afbdd1e 100644 --- a/composer.json +++ b/composer.json @@ -1,68 +1,68 @@ { - "name": "laminas/laminas-cache-storage-adapter-redis", - "description": "Laminas cache adapter for redis", - "keywords": [ - "laminas", - "cache" - ], - "license": "BSD-3-Clause", - "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "ext-redis": "^4.3 || ^5.0.2", - "laminas/laminas-cache": "^3.0" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" - }, - "require-dev": { - "boesing/psalm-plugin-stringf": "^1.2", - "laminas/laminas-cache-storage-adapter-benchmark": "^1.0", - "laminas/laminas-cache-storage-adapter-test": "^2.3", - "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-serializer": "^2.13.0", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.1.0" - }, - "config": { - "sort-packages": true, - "platform": { - "php": "8.0.99" + "name": "laminas/laminas-cache-storage-adapter-redis", + "description": "Laminas cache adapter for redis", + "keywords": [ + "laminas", + "cache" + ], + "license": "BSD-3-Clause", + "require": { + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "ext-redis": "^4.3 || ^5.0.2", + "laminas/laminas-cache": "^3.0" }, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - }, - "extra": { - "laminas": { - "config-provider": "Laminas\\Cache\\Storage\\Adapter\\Redis\\ConfigProvider", - "module": "Laminas\\Cache\\Storage\\Adapter\\Redis" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "LaminasTest\\Cache\\Storage\\Adapter\\": [ - "test/unit", - "test/integration/" - ] + "provide": { + "laminas/laminas-cache-storage-implementation": "1.0" + }, + "require-dev": { + "boesing/psalm-plugin-stringf": "^1.2", + "laminas/laminas-cache-storage-adapter-benchmark": "^1.0", + "laminas/laminas-cache-storage-adapter-test": "^2.3", + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-serializer": "^2.13.0", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.1.0" + }, + "config": { + "sort-packages": true, + "platform": { + "php": "8.0.99" + }, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, + "extra": { + "laminas": { + "config-provider": "Laminas\\Cache\\Storage\\Adapter\\Redis\\ConfigProvider", + "module": "Laminas\\Cache\\Storage\\Adapter\\Redis" + } + }, + "autoload": { + "psr-4": { + "Laminas\\Cache\\Storage\\Adapter\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "LaminasTest\\Cache\\Storage\\Adapter\\": [ + "test/unit", + "test/integration/" + ] + } + }, + "scripts": { + "cs-check": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "static-analysis": "psalm --shepherd --stats" + }, + "support": { + "issues": "https://github.com/laminas/laminas-cache-storage-adapter-redis/issues", + "forum": "https://discourse.laminas.dev/", + "source": "https://github.com/laminas/laminas-cache-storage-adapter-redis", + "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-redis/", + "rss": "https://github.com/laminas/laminas-cache-storage-adapter-redis/releases.atom" } - }, - "scripts": { - "cs-check": "phpcs", - "cs-fix": "phpcbf", - "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", - "static-analysis": "psalm --shepherd --stats" - }, - "support": { - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-redis/issues", - "forum": "https://discourse.laminas.dev/", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-redis", - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-redis/", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-redis/releases.atom" - } } diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4efa208..ffaee4a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -47,7 +47,8 @@ $info['used_memory'] $this->options - + + $options $options @@ -77,6 +78,12 @@ $info + + + $options + $options + + $this->getResourceManager()->getDatabase($this->getResourceId()) @@ -111,11 +118,10 @@ normalizePersistentId normalizeServer - + $k $key $resource - $resource $resource['lib_options'] $resource['persistent_id'] $resource['server'] @@ -128,6 +134,7 @@ $resource['initialized'] $resource['lib_options'] $resource['lib_options'] + $resource['lib_options'][$key] $resource['password'] $resource['password'] $resource['persistent_id'] @@ -141,8 +148,6 @@ $resource['resource'] $resource['resource'] $resource['resource'] - $resource['resource'] - $resource['resource'] $resource['server'] $server['host'] $server['host'] @@ -150,8 +155,6 @@ $server['host'] $server['port'] $server['port'] - $server['port'] - $server['timeout'] $server['timeout'] $server['timeout'] $server['timeout'] @@ -206,10 +209,6 @@ $this->storage->getItem('key') $this->storage->getMetadata($key)['ttl'] - - $options - $storage - $this->storage->getMetadata($key)['ttl'] $this->storage->getMetadata($key)['ttl'] @@ -220,7 +219,6 @@ $this->storage - $this->storage $redis->info() diff --git a/src/Exception/RedisRuntimeException.php b/src/Exception/RedisRuntimeException.php index 9471a23..4bd04d2 100644 --- a/src/Exception/RedisRuntimeException.php +++ b/src/Exception/RedisRuntimeException.php @@ -17,7 +17,7 @@ public static function fromClusterException(RedisClusterException $exception, Re { $message = $redis->getLastError() ?? $exception->getMessage(); - return new self($message, (int) $exception->getCode(), $exception); + return new self($message, $exception->getCode(), $exception); } public static function fromFailedConnection(Throwable $exception): self diff --git a/src/Redis.php b/src/Redis.php index 8da40c4..601cf7e 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -14,7 +14,6 @@ use Redis as RedisResource; use RedisException as RedisResourceException; use stdClass; -use Traversable; use function array_combine; use function array_filter; @@ -49,9 +48,9 @@ final class Redis extends AbstractAdapter implements /** * Create new Adapter for redis storage * - * @see \Laminas\Cache\Storage\Adapter\Abstract + * @see Abstract * - * @param null|array|Traversable|RedisOptions $options + * @param null|iterable|RedisOptions $options */ public function __construct($options = null) { @@ -100,7 +99,7 @@ protected function getRedisResource() * * @see getOptions() * - * @param array|Traversable|RedisOptions $options + * @param iterable|RedisOptions $options * @return Redis */ public function setOptions($options) diff --git a/src/RedisCluster.php b/src/RedisCluster.php index a88c189..473b11c 100644 --- a/src/RedisCluster.php +++ b/src/RedisCluster.php @@ -16,7 +16,6 @@ use RedisClusterException; use RedisException; use stdClass; -use Traversable; use function array_key_exists; use function array_values; @@ -42,8 +41,8 @@ final class RedisCluster extends AbstractAdapter implements private $resourceManager; /** - * @param null|array|Traversable|RedisClusterOptions $options - * @psalm-param array|RedisClusterOptions|Traversable $options + * @param null|iterable|RedisClusterOptions $options + * @psalm-param null|iterable|RedisClusterOptions $options */ public function __construct($options = null) { @@ -60,7 +59,8 @@ public function __construct($options = null) } /** - * @param array|Traversable|AdapterOptions $options + * @param iterable|AdapterOptions $options + * @psalm-param iterable|null|AdapterOptions $options * @return self */ public function setOptions($options) diff --git a/src/RedisClusterOptions.php b/src/RedisClusterOptions.php index db048e7..be6c234 100644 --- a/src/RedisClusterOptions.php +++ b/src/RedisClusterOptions.php @@ -6,7 +6,6 @@ use Laminas\Cache\Exception\RuntimeException; use Laminas\Cache\Storage\Adapter\Exception\InvalidRedisClusterConfigurationException; -use Traversable; final class RedisClusterOptions extends AdapterOptions { @@ -55,8 +54,8 @@ final class RedisClusterOptions extends AdapterOptions private string $password = ''; /** - * @param array|Traversable|null|AdapterOptions $options - * @psalm-param array|Traversable|null|AdapterOptions $options + * @param iterable|null|AdapterOptions $options + * @psalm-param iterable|null|AdapterOptions $options */ public function __construct($options = null) { diff --git a/src/RedisResourceManager.php b/src/RedisResourceManager.php index 50fe8e5..2255bc9 100644 --- a/src/RedisResourceManager.php +++ b/src/RedisResourceManager.php @@ -233,9 +233,8 @@ protected function normalizeServer(&$server) throw new Exception\InvalidArgumentException("Invalid server given"); } - $host = $server['host']; - $port = isset($server['port']) ? (int) $server['port'] : $port; - $timeout = isset($server['timeout']) ? (int) $server['timeout'] : $timeout; + $host = $server['host']; + $port = isset($server['port']) ? (int) $server['port'] : $port; } if (! $host) { @@ -328,7 +327,7 @@ protected function connect(array &$resource) * Set a resource * * @param string $id - * @param array|Traversable|RedisResource $resource + * @param iterable|RedisResource $resource * @return RedisResourceManager Fluent interface */ public function setResource($id, $resource) @@ -557,7 +556,7 @@ public function getLibOption($id, $key) /** * Normalize Redis options * - * @param array|Traversable $libOptions + * @param iterable $libOptions * @throws Exception\InvalidArgumentException * @param-out array $libOptions */ @@ -596,7 +595,7 @@ protected function normalizeLibOptionKey(&$key) throw new Exception\InvalidArgumentException("Unknown redis option '{$key}' ({$const})"); } /** @var int $key */ - $key = constant($const); + $key = (int) constant($const); } /** diff --git a/test/integration/Laminas/RedisTest.php b/test/integration/Laminas/RedisTest.php index 6b822d5..3e8736d 100644 --- a/test/integration/Laminas/RedisTest.php +++ b/test/integration/Laminas/RedisTest.php @@ -4,7 +4,6 @@ namespace LaminasTest\Cache\Storage\Adapter\Laminas; -use Laminas\Cache; use Laminas\Cache\Storage\Adapter\Redis; use Laminas\Cache\Storage\Adapter\RedisOptions; use Laminas\Cache\Storage\Adapter\RedisResourceManager; @@ -19,14 +18,15 @@ use function getenv; /** - * @covers Laminas\Cache\Storage\Adapter\Redis + * @covers Redis + * @template-extends AbstractCommonAdapterTest */ final class RedisTest extends AbstractCommonAdapterTest { - /** @var Cache\Storage\Adapter\RedisOptions */ + /** @var RedisOptions */ protected $options; - /** @var Cache\Storage\Adapter\Redis */ + /** @var Redis */ protected $storage; public function setUp(): void @@ -47,8 +47,8 @@ public function setUp(): void $options['password'] = getenv('TESTS_LAMINAS_CACHE_REDIS_PASSWORD'); } - $this->options = new Cache\Storage\Adapter\RedisOptions($options); - $this->storage = new Cache\Storage\Adapter\Redis($this->options); + $this->options = new RedisOptions($options); + $this->storage = new Redis($this->options); parent::setUp(); } @@ -96,8 +96,8 @@ public function testLibOptionsFirst(): void $options['password'] = getenv('TESTS_LAMINAS_CACHE_REDIS_PASSWORD'); } - $redisOptions = new Cache\Storage\Adapter\RedisOptions($options); - $storage = new Cache\Storage\Adapter\Redis($redisOptions); + $redisOptions = new RedisOptions($options); + $storage = new Redis($redisOptions); $this->assertInstanceOf(Redis::class, $storage); } @@ -230,7 +230,7 @@ public function testGetSetLibOptionsWithCleanRedisResourceInstance(): void $options = ['serializer' => RedisResource::SERIALIZER_PHP]; $this->options->setLibOptions($options); - $redis = new Cache\Storage\Adapter\Redis($this->options); + $redis = new Redis($this->options); $value = ['value']; $key = 'key'; //test if it's still possible to set/get item and if lib serializer works From d269e548b1982cd7e0d349ec64872abe82e96430 Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sun, 18 Dec 2022 13:18:44 +0000 Subject: [PATCH 4/7] fix some of the easier psalm errors Signed-off-by: Gary Lockett --- src/Exception/RedisRuntimeException.php | 2 +- src/RedisCluster.php | 2 -- src/RedisClusterOptions.php | 1 - src/RedisResourceManager.php | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Exception/RedisRuntimeException.php b/src/Exception/RedisRuntimeException.php index 4bd04d2..d2fe05a 100644 --- a/src/Exception/RedisRuntimeException.php +++ b/src/Exception/RedisRuntimeException.php @@ -37,6 +37,6 @@ public static function fromRedisException(RedisException $exception, Redis $redi $message = $exception->getMessage(); } - return new self($message, (int) $exception->getCode(), $exception); + return new self($message, $exception->getCode(), $exception); } } diff --git a/src/RedisCluster.php b/src/RedisCluster.php index 473b11c..7847cb6 100644 --- a/src/RedisCluster.php +++ b/src/RedisCluster.php @@ -46,7 +46,6 @@ final class RedisCluster extends AbstractAdapter implements */ public function __construct($options = null) { - /** @psalm-suppress PossiblyInvalidArgument */ parent::__construct($options); $eventManager = $this->getEventManager(); @@ -66,7 +65,6 @@ public function __construct($options = null) public function setOptions($options) { if (! $options instanceof RedisClusterOptions) { - /** @psalm-suppress PossiblyInvalidArgument */ $options = new RedisClusterOptions($options); } diff --git a/src/RedisClusterOptions.php b/src/RedisClusterOptions.php index be6c234..d403cc4 100644 --- a/src/RedisClusterOptions.php +++ b/src/RedisClusterOptions.php @@ -63,7 +63,6 @@ public function __construct($options = null) $options = $options->toArray(); } - /** @psalm-suppress InvalidArgument */ parent::__construct($options); $hasName = $this->hasName(); $hasSeeds = $this->getSeeds() !== []; diff --git a/src/RedisResourceManager.php b/src/RedisResourceManager.php index 2255bc9..2b68f77 100644 --- a/src/RedisResourceManager.php +++ b/src/RedisResourceManager.php @@ -594,7 +594,6 @@ protected function normalizeLibOptionKey(&$key) if (! defined($const)) { throw new Exception\InvalidArgumentException("Unknown redis option '{$key}' ({$const})"); } - /** @var int $key */ $key = (int) constant($const); } From 010343b9d8fbd999c02925d77520e953beb595ff Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sun, 18 Dec 2022 13:49:36 +0000 Subject: [PATCH 5/7] use assertion over casting Signed-off-by: Gary Lockett --- src/RedisResourceManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RedisResourceManager.php b/src/RedisResourceManager.php index 2b68f77..e212190 100644 --- a/src/RedisResourceManager.php +++ b/src/RedisResourceManager.php @@ -594,7 +594,8 @@ protected function normalizeLibOptionKey(&$key) if (! defined($const)) { throw new Exception\InvalidArgumentException("Unknown redis option '{$key}' ({$const})"); } - $key = (int) constant($const); + $key = constant($const); + assert(is_int($key)); } /** From 002bf47a745b5a57aef201619b235493469c4ed4 Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sun, 18 Dec 2022 13:58:33 +0000 Subject: [PATCH 6/7] import is_int function# Signed-off-by: Gary Lockett --- src/RedisResourceManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RedisResourceManager.php b/src/RedisResourceManager.php index e212190..c89c705 100644 --- a/src/RedisResourceManager.php +++ b/src/RedisResourceManager.php @@ -17,6 +17,7 @@ use function constant; use function defined; use function is_array; +use function is_int; use function is_string; use function method_exists; use function parse_url; From 83bdcc0e13b716dfca797ba10c4223f91a3eb1f2 Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Sun, 18 Dec 2022 13:59:51 +0000 Subject: [PATCH 7/7] add coeerced type errors to baseline Signed-off-by: Gary Lockett --- psalm-baseline.xml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ffaee4a..57d85f5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -106,11 +106,13 @@ $server instanceof Traversable is_array($resource) - + + $info $this - + RedisResource + array{redis_version:string} normalizeLibOptionKey @@ -118,14 +120,25 @@ normalizePersistentId normalizeServer - + $k $key $resource + $resource['database'] $resource['lib_options'] $resource['persistent_id'] + $resource['persistent_id'] $resource['server'] $server + $server['host'] + $server['host'] + $server['host'] + $server['host'] + $server['port'] + $server['port'] + $server['timeout'] + $server['timeout'] + $server['timeout'] $resource['database']