From fc692e2270d82ad4f2f35311bac62f16f2031198 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 19:11:45 +0100 Subject: [PATCH 01/16] Remove support for PHP 8.0 Also, stop ignoring platform reqs on 8.2 and bump dev dependencies Signed-off-by: George Steel --- .laminas-ci.json | 3 - composer.json | 12 +- composer.lock | 506 ++++++++++++++++++++--------------------------- 3 files changed, 220 insertions(+), 301 deletions(-) diff --git a/.laminas-ci.json b/.laminas-ci.json index 6d7c4b7b..2c63c085 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -1,5 +1,2 @@ { - "ignore_php_platform_requirements": { - "8.2": true - } } diff --git a/composer.json b/composer.json index 82cac674..fd11a4d9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "composer/package-versions-deprecated": true }, "platform": { - "php": "8.0.99" + "php": "8.1.99" } }, "extra": { @@ -32,20 +32,20 @@ } }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0", "ext-mbstring": "*", "laminas/laminas-servicemanager": "^3.14.0", "laminas/laminas-stdlib": "^3.13.0" }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-crypt": "^3.9", + "laminas/laminas-crypt": "^3.10", "laminas/laminas-uri": "^2.10", "pear/archive_tar": "^1.4.14", - "phpunit/phpunit": "^9.5.27", + "phpunit/phpunit": "^9.6.8", "psalm/plugin-phpunit": "^0.18.4", - "psr/http-factory": "^1.0.1", - "vimeo/psalm": "^5.3" + "psr/http-factory": "^1.0.2", + "vimeo/psalm": "^5.11" }, "conflict": { "laminas/laminas-validator": "<2.10.1", diff --git a/composer.lock b/composer.lock index 2012a9ee..bf629324 100644 --- a/composer.lock +++ b/composer.lock @@ -4,30 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c98291c87c80beaa1f7039dfa117b708", + "content-hash": "f94fd68c5868ed8c7a93ac287998405f", "packages": [ { "name": "laminas/laminas-servicemanager", - "version": "3.20.0", + "version": "3.21.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59" + "reference": "625f2aa3bc6dd02688b2da5155b3a69870812bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", - "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/625f2aa3bc6dd02688b2da5155b3a69870812bda", + "reference": "625f2aa3bc6dd02688b2da5155b3a69870812bda", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^3.2.1", - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "laminas/laminas-stdlib": "^3.17", + "php": "~8.1.0 || ~8.2.0", "psr/container": "^1.0" }, "conflict": { "ext-psr": "*", - "laminas/laminas-code": "<3.3.1", + "laminas/laminas-code": "<4.10.0", "zendframework/zend-code": "<3.3.1", "zendframework/zend-servicemanager": "*" }, @@ -39,18 +39,19 @@ }, "require-dev": { "composer/package-versions-deprecated": "^1.11.99.5", - "laminas/laminas-coding-standard": "~2.4.0", + "friendsofphp/proxy-manager-lts": "^1.0.14", + "laminas/laminas-code": "^4.10.0", + "laminas/laminas-coding-standard": "~2.5.0", "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" + "mikey179/vfsstream": "^1.6.11", + "phpbench/phpbench": "^1.2.9", + "phpunit/phpunit": "^10.0.17", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.8.0" }, "suggest": { - "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" + "friendsofphp/proxy-manager-lts": "ProxyManager ^2.1.1 to handle lazy initialization of services" }, "bin": [ "bin/generate-deps-for-config-factory", @@ -94,34 +95,34 @@ "type": "community_bridge" } ], - "time": "2022-12-01T17:03:38+00:00" + "time": "2023-05-14T12:24:54+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.16.1", + "version": "3.17.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17" + "reference": "dd35c868075bad80b6718959740913e178eb4274" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/f4f773641807c7ccee59b758bfe4ac4ba33ecb17", - "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/dd35c868075bad80b6718959740913e178eb4274", + "reference": "dd35c868075bad80b6718959740913e178eb4274", "shasum": "" }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0" + "php": "~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-stdlib": "*" }, "require-dev": { - "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" + "laminas/laminas-coding-standard": "^2.5", + "phpbench/phpbench": "^1.2.9", + "phpunit/phpunit": "^10.0.16", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.8" }, "type": "library", "autoload": { @@ -153,7 +154,7 @@ "type": "community_bridge" } ], - "time": "2022-12-03T18:48:01+00:00" + "time": "2023-03-20T13:51:37+00:00" }, { "name": "psr/container", @@ -776,30 +777,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -826,7 +827,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -842,7 +843,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -947,16 +948,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "0.4.1", + "version": "0.5.1", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" + "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", "shasum": "" }, "require": { @@ -996,7 +997,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" }, "funding": [ { @@ -1004,7 +1005,7 @@ "type": "github" } ], - "time": "2022-12-16T22:01:02+00:00" + "time": "2022-12-24T12:35:10+00:00" }, { "name": "laminas/laminas-coding-standard", @@ -1064,16 +1065,16 @@ }, { "name": "laminas/laminas-crypt", - "version": "3.9.0", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-crypt.git", - "reference": "56ab1b195dad5456753601ff2e8e3d3fd9392d1a" + "reference": "588375caf4d505fee90d1449e9714c912ceb5051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-crypt/zipball/56ab1b195dad5456753601ff2e8e3d3fd9392d1a", - "reference": "56ab1b195dad5456753601ff2e8e3d3fd9392d1a", + "url": "https://api.github.com/repos/laminas/laminas-crypt/zipball/588375caf4d505fee90d1449e9714c912ceb5051", + "reference": "588375caf4d505fee90d1449e9714c912ceb5051", "shasum": "" }, "require": { @@ -1124,7 +1125,7 @@ "type": "community_bridge" } ], - "time": "2022-10-16T15:51:01+00:00" + "time": "2023-03-03T15:57:57+00:00" }, { "name": "laminas/laminas-escaper", @@ -1315,16 +1316,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.29.0", + "version": "2.30.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "e40ee8d86cc1907083e273bfd6ed8b6dde2d9850" + "reference": "b7d217b5e4951955fda9a3a5ada91b717b5c8d5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/e40ee8d86cc1907083e273bfd6ed8b6dde2d9850", - "reference": "e40ee8d86cc1907083e273bfd6ed8b6dde2d9850", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/b7d217b5e4951955fda9a3a5ada91b717b5c8d5c", + "reference": "b7d217b5e4951955fda9a3a5ada91b717b5c8d5c", "shasum": "" }, "require": { @@ -1396,20 +1397,20 @@ "type": "community_bridge" } ], - "time": "2022-12-13T22:53:38+00:00" + "time": "2023-01-30T22:41:19+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -1447,7 +1448,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -1455,20 +1456,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.1.0", + "version": "v4.2.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" + "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", - "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", + "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", "shasum": "" }, "require": { @@ -1504,22 +1505,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" }, - "time": "2022-12-08T20:46:14+00:00" + "time": "2023-04-09T17:37:40+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -1560,9 +1561,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "pear/archive_tar", @@ -1697,16 +1698,16 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.11", + "version": "v1.10.13", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "68d0d32ada737153b7e93b8d3c710ebe70ac867d" + "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/68d0d32ada737153b7e93b8d3c710ebe70ac867d", - "reference": "68d0d32ada737153b7e93b8d3c710ebe70ac867d", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/aed862e95fd286c53cc546734868dc38ff4b5b1d", + "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d", "shasum": "" }, "require": { @@ -1741,7 +1742,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", "source": "https://github.com/pear/pear-core-minimal" }, - "time": "2021-08-10T22:31:03+00:00" + "time": "2023-04-19T19:15:47+00:00" }, { "name": "pear/pear_exception", @@ -2124,23 +2125,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.23", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -2155,8 +2156,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -2189,7 +2190,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -2197,7 +2198,7 @@ "type": "github" } ], - "time": "2022-12-28T12:41:10+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2442,16 +2443,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.28", + "version": "9.6.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e" + "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e", - "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", "shasum": "" }, "require": { @@ -2484,8 +2485,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -2493,7 +2494,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -2524,7 +2525,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" }, "funding": [ { @@ -2540,7 +2542,7 @@ "type": "tidelift" } ], - "time": "2023-01-14T12:32:24+00:00" + "time": "2023-05-11T05:14:45+00:00" }, { "name": "psalm/plugin-phpunit", @@ -2604,21 +2606,21 @@ }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -2638,7 +2640,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -2653,31 +2655,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -2706,9 +2708,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", @@ -3060,16 +3062,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -3114,7 +3116,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -3122,20 +3124,20 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -3177,7 +3179,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -3185,7 +3187,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -3499,16 +3501,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -3547,10 +3549,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "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.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -3558,7 +3560,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -3617,16 +3619,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -3661,7 +3663,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -3669,7 +3671,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -3787,26 +3789,25 @@ }, { "name": "spatie/array-to-xml", - "version": "2.17.1", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46" + "reference": "e210b98957987c755372465be105d32113f339a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", - "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/e210b98957987c755372465be105d32113f339a4", + "reference": "e210b98957987c755372465be105d32113f339a4", "shasum": "" }, "require": { "ext-dom": "*", - "php": "^7.4|^8.0" + "php": "^8.0" }, "require-dev": { "mockery/mockery": "^1.2", "pestphp/pest": "^1.21", - "phpunit/phpunit": "^9.0", "spatie/pest-plugin-snapshots": "^1.1" }, "type": "library", @@ -3835,7 +3836,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/2.17.1" + "source": "https://github.com/spatie/array-to-xml/tree/3.1.6" }, "funding": [ { @@ -3847,20 +3848,20 @@ "type": "github" } ], - "time": "2022-12-26T08:22:07+00:00" + "time": "2023-05-11T14:04:07+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -3896,31 +3897,33 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", - "version": "v6.0.17", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2ab307342a7233b9a260edd5ef94087aaca57d18" + "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2ab307342a7233b9a260edd5ef94087aaca57d18", - "reference": "2ab307342a7233b9a260edd5ef94087aaca57d18", + "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", + "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.4|^6.0" @@ -3977,12 +3980,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.17" + "source": "https://github.com/symfony/console/tree/v6.2.10" }, "funding": [ { @@ -3998,29 +4001,29 @@ "type": "tidelift" } ], - "time": "2022-12-28T14:21:34+00:00" + "time": "2023-04-28T13:37:43+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -4049,7 +4052,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" }, "funding": [ { @@ -4065,24 +4068,24 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2023-03-01T10:25:55+00:00" }, { "name": "symfony/filesystem", - "version": "v6.0.13", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3adca49133bd055ebe6011ed1e012be3c908af79" + "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3adca49133bd055ebe6011ed1e012be3c908af79", - "reference": "3adca49133bd055ebe6011ed1e012be3c908af79", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894", + "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -4112,7 +4115,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.13" + "source": "https://github.com/symfony/filesystem/tree/v6.2.10" }, "funding": [ { @@ -4128,7 +4131,7 @@ "type": "tidelift" } ], - "time": "2022-09-21T20:25:27+00:00" + "time": "2023-04-18T13:46:08+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4460,89 +4463,6 @@ ], "time": "2022-11-03T14:55:06+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "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\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/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/service-contracts", "version": "v2.5.2", @@ -4628,20 +4548,20 @@ }, { "name": "symfony/string", - "version": "v6.0.17", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "3f57003dd8a67ed76870cc03092f8501db7788d9" + "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/3f57003dd8a67ed76870cc03092f8501db7788d9", - "reference": "3f57003dd8a67ed76870cc03092f8501db7788d9", + "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", + "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -4653,6 +4573,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -4693,7 +4614,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.17" + "source": "https://github.com/symfony/string/tree/v6.2.8" }, "funding": [ { @@ -4709,7 +4630,7 @@ "type": "tidelift" } ], - "time": "2022-12-14T15:52:41+00:00" + "time": "2023-03-20T16:06:02+00:00" }, { "name": "theseer/tokenizer", @@ -4763,22 +4684,22 @@ }, { "name": "vimeo/psalm", - "version": "5.4.0", + "version": "5.11.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863" + "reference": "c9b192ab8400fdaf04b2b13d110575adc879aa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", - "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/c9b192ab8400fdaf04b2b13d110575adc879aa90", + "reference": "c9b192ab8400fdaf04b2b13d110575adc879aa90", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.10.0", + "composer-runtime-api": "^2", "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", @@ -4791,28 +4712,28 @@ "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.1", "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.0", + "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.14", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", - "sebastian/diff": "^4.0", - "spatie/array-to-xml": "^2.17.0", + "sebastian/diff": "^4.0 || ^5.0", + "spatie/array-to-xml": "^2.17.0 || ^3.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/polyfill-php80": "^1.25" + "symfony/filesystem": "^5.4 || ^6.0" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { + "amphp/phpunit-util": "^2.0", "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.0", + "brianium/paratest": "^6.9", "ext-curl": "*", "mockery/mockery": "^1.5", "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6", "psalm/plugin-mockery": "^1.1", "psalm/plugin-phpunit": "^0.18", "slevomat/coding-standard": "^8.4", @@ -4858,34 +4779,35 @@ "keywords": [ "code", "inspection", - "php" + "php", + "static analysis" ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.4.0" + "source": "https://github.com/vimeo/psalm/tree/5.11.0" }, - "time": "2022-12-19T21:31:12+00:00" + "time": "2023-05-04T21:35:44+00:00" }, { "name": "webimpress/coding-standard", - "version": "1.2.4", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/webimpress/coding-standard.git", - "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9" + "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", - "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", + "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/b26557e2386711ecb74f22718f4b4bde5ddbc899", + "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899", "shasum": "" }, "require": { "php": "^7.3 || ^8.0", - "squizlabs/php_codesniffer": "^3.6.2" + "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "phpunit/phpunit": "^9.5.13" + "phpunit/phpunit": "^9.6.4" }, "type": "phpcodesniffer-standard", "extra": { @@ -4911,7 +4833,7 @@ ], "support": { "issues": "https://github.com/webimpress/coding-standard/issues", - "source": "https://github.com/webimpress/coding-standard/tree/1.2.4" + "source": "https://github.com/webimpress/coding-standard/tree/1.3.1" }, "funding": [ { @@ -4919,7 +4841,7 @@ "type": "github" } ], - "time": "2022-02-15T19:52:12+00:00" + "time": "2023-03-09T15:05:18+00:00" }, { "name": "webmozart/assert", @@ -4986,12 +4908,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0", "ext-mbstring": "*" }, "platform-dev": [], "platform-overrides": { - "php": "8.0.99" + "php": "8.1.99" }, "plugin-api-version": "2.3.0" } From f148180c1ab3ff79b1df2f2c545743abcf31bce7 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 19:37:12 +0100 Subject: [PATCH 02/16] Fix new psalm issues, base-lining issues that are either unfixable, or require too much work to fix right now Signed-off-by: George Steel --- psalm-baseline.xml | 1370 +++++++++-------- src/Encrypt/Openssl.php | 2 +- src/RealPath.php | 2 +- src/UriNormalize.php | 6 +- test/BooleanTest.php | 2 +- test/Compress/RarTest.php | 1 + test/File/RenameTest.php | 3 + test/FilterPluginManagerCompatibilityTest.php | 3 +- test/FilterPluginManagerFactoryTest.php | 1 - test/StaticFilterTest.php | 3 + .../CamelCaseToSeparatorNoPcreUnicodeTest.php | 1 - 11 files changed, 704 insertions(+), 690 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 85efd442..3d790d14 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,561 +1,558 @@ - + - + filterable - + $expectedInputs - - array_reduce($value, self::class . '::reduce', true) + + - - array_reduce($value, self::class . '::reduce', false) + + - + gettype($options) - + [] - + $value - - $this->options + + options]]> - + is_object($options) - + assert(is_string($encoding)) is_string($encoding) - + is_string($encoding) - + (bool) $strict - + $typeOrOptions - - ! is_array($translations) && ! $translations instanceof Traversable + + - - $this->options['translations'][$message] + + options['translations'][$message]]]> - + $flag $message - + $value - + $type - - $this->options['casting'] - $this->options['translations'] - $this->options['type'] + + options['casting']]]> + options['translations']]]> + options['type']]]> - + (bool) $flag - + is_int($value) - - call_user_func_array($this->options['callback'], $params) + + options['callback'], $params)]]> - + array callable - + new $callback() - - $this->options['callback'] - $this->options['callback_params'] + + options['callback']]]> + options['callback_params']]]> - + $options - + $callbackOrOptions - + (array) $params - + ! is_array($options) is_string($adapter) - + mixed - + $adapter $adapterOptions - + $adapter $adapter $key - $this->adapter + adapter]]> - + $adapter $key $value - + array - + new $adapter($options) - - $this->adapterOptions + + adapterOptions]]> - + $options - + getOptions - + [] - + $option - - $this->options[$option] + + options[$option]]]> - + $compressed - + string - + $content $content - - $this->options['archive'] - $this->options['blocksize'] + + options['archive']]]> + options['blocksize']]]> - + (int) $blocksize (string) $archive - + null !== $content null !== $content - + bzclose bzclose bzwrite - + $compressed - + string - + $size - + $size - + $content $content - - $this->options['archive'] - $this->options['level'] - $this->options['mode'] - $this->options['mode'] + + options['archive']]]> + options['level']]]> + options['mode']]]> + options['mode']]]> - + (int) $level (string) $archive - - $mode === 'deflate' && null !== $content + + null !== $content null !== $content null !== $content - + $content $content - + bool string|null - - extract - - + $content $content - - $this->options['archive'] - $this->options['callback'] - $this->options['password'] - $this->options['target'] + + options['archive']]]> + options['callback']]]> + options['password']]]> + options['target']]]> - + (string) $archive (string) $target - + (string) $password - + ! $archive ! $filelist $archive $filelist - - rar_close - + + $filelist + - + $compressed $compressed - + string string - + $compressed $compressed - + $content $content - + snappy_compress($content) snappy_uncompress($content) - + $result === false - + string - + $content - + $file[] - + $content $directory $file[] $info - + isFile - - $this->getArchive() + + getArchive()]]> - + $content $content - + $content - - $this->getArchive() + + getArchive()]]> - - $this->options['target'] + + options['target']]]> - + $file $file - + (string) $target - + (string) $archive - + $res $res $res $res $res - + string - + $res - - $this->options['archive'] + + options['archive']]]> - + $content $content - + strrpos($content, DIRECTORY_SEPARATOR) strrpos($content, DIRECTORY_SEPARATOR) - - $this->getArchive() + + getArchive()]]> - - $this->options['archive'] - $this->options['archive'] - $this->options['target'] + + options['archive']]]> + options['archive']]]> + options['target']]]> - + (string) $target - + (string) $archive - + $res !== true - + setMode setPrecision setPrefixes setUnit - + $prefixes[$index] - - $this->options['mode'] - $this->options['precision'] - $this->options['prefixes'] - $this->options['unit'] + + options['mode']]]> + options['precision']]]> + options['prefixes']]]> + options['unit']]]> - + (int) $precision (string) $unit - + $result - - $e->getCode() + + getCode()]]> - + ! is_string($value) - + $value - + $value $value $value - + $value - + Encrypt - + Decrypt - + is_string($value) - + string - + decrypt - - $this->adapter->decrypt($value) + + adapter->decrypt($value)]]> $value - + $value - + (bool) $strict - + Encrypt Encrypt\EncryptionAlgorithmInterface - + ! is_string($value) - + new $adapter($options) - + $adapter - + $adapter $adapter $adapter $adapter $adapter $adapter - $this->adapter - $this->adapter + adapter]]> + adapter]]> - + $adapter $adapter - + string string - + encrypt new $adapter($options) new $adapter($options) toString - - $this->adapter->encrypt($value) - $this->adapter->toString() + + adapter->encrypt($value)]]> + adapter->toString()]]> $value - + $value - + BlockCipher - + is_array($options) is_array($options) - is_string($this->compression) + compression)]]> - - CryptBlockCipher::factory($cipherType, $this->encryption) + + encryption)]]> - + $encryption - $this->encryption - $this->encryption - $this->encryption + encryption]]> + encryption]]> + encryption]]> - - $options['compression'] - $options['key'] - $options['vector'] - $this->encryption + + + + + encryption]]> $value - - $options['algorithm'] - $options['algorithm'] - $options['hash'] - $options['hash'] - $options['key'] - $options['key_iteration'] - $options['vector'] - $this->encryption['key'] - $this->encryption['vector'] + + + + + + + + + encryption['key']]]> + encryption['vector']]]> - - $this->encryption['key'] - $this->encryption['key'] - $this->encryption['vector'] + + encryption['key']]]> + encryption['key']]]> + encryption['vector']]]> - + $options $value - + array string string - - $this->encryption + + encryption]]> - - $this->encryption - $this->encryption['key'] - $this->encryption['vector'] + + encryption]]> + encryption['key']]]> + encryption['vector']]]> - + $compression - + $compression - + setCipherAlgorithm setHashAlgorithm setKeyIteration @@ -563,271 +560,281 @@ - + Openssl - + is_array($keys) - + array_values($keys) - - $cert - $cert - $cert - $details['key'] - $details['key'] + + + $envKey - $header['size'] + $length $length - $options['compression'] - $options['package'] - $options['passphrase'] + + + - + + $key + $key + $key + $options + + $fingerprints[$key] - - $cert + $count $envKey $i $i - $key - $key['envelope'] - $key['private'] - $key['public'] + + + $length $option $option $option - - $header['size'] + + $i - - $this->keys - $this->keys - $this->keys - $this->keys - - + + keys]]> + + (bool) $package + + is_string($key) + - + Filter\Decrypt Filter\Decrypt parent::filter($content) - + Decrypt - - ! is_scalar($value) && ! is_array($value) + + - + string|array string|array - - $this->filename - $this->filename - $this->filename + + filename]]> + filename]]> + filename]]> $value $value - - $uploadData['tmp_name'] + + - - $this->filename - $uploadData['tmp_name'] + + filename]]> + $value - + string|array - - $this->filename - $this->filename + + filename]]> + filename]]> $uploadData $value - + $value - + $filename - + $uploadData - + $filename - - isset($this->filename) + + filename)]]> - + Filter\Encrypt parent::filter($content) - + Encrypt - - ! is_scalar($value) && ! is_array($value) + + - + string|array - - $this->filename - $this->filename - $this->filename + + filename]]> + filename]]> + filename]]> $value $value - - $uploadData['tmp_name'] + + - - $this->filename - $uploadData['tmp_name'] + + filename]]> + $value - + string|array - - $this->filename - $this->filename + + filename]]> + filename]]> $uploadData $value - + $value - + $filename - + $uploadData - + $filename - - isset($this->filename) + + filename)]]> - + $value - + $uploadData - - ! is_scalar($value) && ! is_array($value) + + is_array($options) is_array($options) - - $files['overwrite'] - $files['randomize'] + + + - + $file $this $this - + array - - $file['source'] - $file['source'] - $file['target'] - $file['target'] - $file['target'] - $file['target'] - $file['target'] + + + + + + + + $value $value - + $options - - $file['source'] - $file['target'] - $file['target'] - $file['target'] + + + + + - - $uploadData['tmp_name'] + + - - $uploadData['tmp_name'] + + $value $value - + string string|array - - $file['target'] - $file['target'] + + + $uploadData $uploadData $value - + $value - - $rename['randomize'] + + - + $uploadData $uploadData - - $this->files + + files]]> - + is_string($file) - + $target === null is_string($target) - + string - - $this->options - $this->options - $this->options - $this->options - $this->options - $this->options - $this->options + + options]]> + options]]> + options]]> + options]]> + options]]> + options]]> + options]]> + null, + 'use_upload_name' => false, + 'use_upload_extension' => false, + 'overwrite' => false, + 'randomize' => false, + 'stream_factory' => null, + 'upload_file_factory' => null, + ]]]> - + $clientFilename $sourceFile $sourceFile @@ -835,62 +842,62 @@ $sourceFile $sourceFile - + $value - - $this->alreadyFiltered[$sourceFile] - $this->alreadyFiltered[$sourceFile] - $this->alreadyFiltered[$sourceFile] + + alreadyFiltered[$sourceFile]]]> + alreadyFiltered[$sourceFile]]]> + alreadyFiltered[$sourceFile]]]> - + $clientFilename $sourceFile $sourceFile - + UploadedFileInterface - array<string, string> + ]]> string - - $this->alreadyFiltered[$alreadyFilteredKey] - $this->alreadyFiltered[$fileName] - $this->alreadyFiltered[$sourceFile] + + alreadyFiltered[$alreadyFilteredKey]]]> + alreadyFiltered[$fileName]]]> + alreadyFiltered[$sourceFile]]]> - + $fileData - $this->alreadyFiltered[$sourceFile] + alreadyFiltered[$sourceFile]]]> - + $value - - $this->options['target'] + + options['target']]]> - + $sourceFile $sourceFile - + $sourceFile $sourceFile - + $clientFileName $clientFileName $clientFileName - - $this->options['overwrite'] - $this->options['randomize'] - $this->options['stream_factory'] - $this->options['target'] - $this->options['upload_file_factory'] - $this->options['use_upload_extension'] - $this->options['use_upload_name'] + + options['overwrite']]]> + options['randomize']]]> + options['stream_factory']]]> + options['target']]]> + options['upload_file_factory']]]> + options['use_upload_extension']]]> + options['use_upload_name']]]> - + (bool) $flag (bool) $flag (bool) $flag @@ -898,48 +905,48 @@ - - ! is_scalar($value) && ! is_array($value) + + - + $value $value $value $value - + $value - + string|array - + $uploadData $value $value $value - + $value $value - + $uploadData - + new PriorityQueue() - + $options - + strtolower - + Blacklist::class Decrypt::class Decrypt::class @@ -965,20 +972,20 @@ File\Encrypt::class Whitelist::class - - ToInt::class => InvokableFactory::class - ToNull::class => InvokableFactory::class + + InvokableFactory::class]]> + InvokableFactory::class]]> - + ($name is class-string ? InstanceType : callable(mixed): mixed) - + $factories - + $name - + Alnum Alnum Alnum @@ -1004,123 +1011,126 @@ - + $options ?: [] - + + + + FilterPluginManagerFactory - + $name $name $requestedName - + $creationOptions - - $config['filters'] - $this->creationOptions + + + creationOptions]]> - + $container - + is_array($options) - - $options['doublequote'] - $options['encoding'] - $options['quotestyle'] + + + + - - $options['encoding'] - $temp['charset'] - $temp['quotestyle'] + + + + - + $temp - + (bool) $doubleQuote (string) $value - - $options['pluginManager'] + + - + $spec[0] - - $source[ltrim($sourceName, ':')] + + - - $options['pluginManager'] - $options['rules'] - $options['target'] - $options['targetReplacementIdentifier'] - $options['throwTargetExceptionsOn'] + + + + + + $processedPart $rule $rules[$spec] $source[$ruleName] $spec - + $sourceName $spec - - $this->rules[$spec][] + + rules[$spec][]]]> - + $processedPart $processedPart $rule $ruleFilter $ruleValue $sourceValue - $source[ltrim($sourceName, ':')] - $temp['rules'] - $temp['target'] - $temp['targetReplacementIdentifier'] - $temp['throwTargetExceptionsOn'] + + + + + - + $ruleFilter($processedPart) - + FilterInterface|false array|false - - new $options['pluginManager']() + + - - $this->rules[$spec] - $this->rules[$spec][$index] + + rules[$spec]]]> + rules[$spec][$index]]]> - - $source[ltrim($sourceName, ':')] + + - + $source - + $source - + $pluginManager $target - + (string) $targetReplacementIdentifier - + (bool) $throwTargetExceptionsOn (string) $rule (string) $spec @@ -1129,180 +1139,193 @@ - + getConfig - + ModuleManager - - ! is_array($pattern) && ! is_string($pattern) - ! is_array($replacement) && ! is_string($replacement) + + + - + bool - + $args[0] $args[1] - - $this->options['pattern'] - $this->options['pattern'] - $this->options['pattern'] - $this->options['replacement'] - $this->options['replacement'] + + options['pattern']]]> + options['pattern']]]> + options['pattern']]]> + options['replacement']]]> + options['replacement']]]> - - $this->options + + options]]> + true, + ]]]> - + $existsOrOptions $existsOrOptions - - $this->options['exists'] - $this->options['exists'] + + options['exists']]]> + options['exists']]]> - + (bool) $flag - + $existsOrOptions !== null - + is_string($prefix) - + is_string($suffix) - + $encodingOrOptions $encodingOrOptions - + $encodingOrOptions $encodingOrOptions - - $this->options['charlist'] - $this->options['charlist'] - $this->options['charlist'] + + options['charlist']]]> + options['charlist']]]> + options['charlist']]]> - + is_scalar($value) - - $options['allowAttribs'] - $options['allowTags'] - $this->tagsAllowed[$tagName] + + + + tagsAllowed[$tagName]]]> - - $this->tagsAllowed[$tagName][$attributeName] + + tagsAllowed[$tagName][$attributeName]]]> - + $attribute $attribute $element - $temp['allowAttribs'] - $temp['allowComments'] - $temp['allowTags'] + + + - + $value - + $temp - + (string) $value (string) $value - + is_array($options) - + - + $typeOrOptions - - $typeOrOptions === '' - $typeOrOptions === '' + + + - + $value - + $type - - $this->options['type'] + + options['type']]]> - + is_int($value) - + $encodingOrOptions $encodingOrOptions - - + + enforcedScheme && ! $uri->getScheme()) { + $this->enforceScheme($uri); + } + } catch (UriException) { + // We are unable to parse / enforce scheme with the given config and input + return $value; + }]]> + + $defaultScheme - + is_string($separator) - + $separator - + $separator - + $separator - - is_array($separator) && isset($separator['separator']) && is_string($separator['separator']) - is_string($separator['separator']) + + + - + $matches $matches $matches $matches - + $matches[1] $matches[1] $matches[2] $matches[2] - + $matches[1] $matches[1] $matches[2] @@ -1310,152 +1333,147 @@ - - $this->searchSeparator === null + + searchSeparator === null]]> - + + + - + SeparatorToSeparatorFactory - + $creationOptions - + setCreationOptions - - $options['replacement_separator'] ?? '-' - $options['search_separator'] ?? ' ' + + + - + $value - + static function ($value) { - + $value $value $value - + is_array($value) ? array_map($lowerCaseFirst, $value) : $lowerCaseFirst($value) - + class extends AbstractUnicode { - + $strict - + $expected $value - + $data [$value, $expected] - + new BlacklistFilter() - + $type - + $value $value $value $value - + $expected $expected $value $value - + $data $data $type [$value, $expected] [$value, $expected] - + array - + testTypes - - 'param' - 'param' + + + - + assertTrue assertTrue - + testBz2DecompressNullValueIsAccepted - + null null - + assertTrue - + null null - + new Lzf() new Lzf() - - new RarCompression() - new RarCompression() - new RarCompression() - new RarCompression() - new RarCompression() - new RarCompression() - new RarCompression() - new RarCompression() - - + true - + unknown - + unknown - + new SnappyCompression() new SnappyCompression() new SnappyCompression() @@ -1463,187 +1481,191 @@ new SnappyCompression() new SnappyCompression() - + + expectError + expectErrorMessage + + $errno $errstr - + $compressed - + getArchive getArchive - + $adapter - + $compressed $input - + $compressed - + null - + $expected $value - + $data [$value, $expected] - + $input - + returnUnfilteredDataProvider - - $this->testDir - $this->testDir - $this->testFile - $this->testFile - $this->testFile - $this->testFile - $this->testFile + + testDir]]> + testDir]]> + testFile]]> + testFile]]> + testFile]]> + testFile]]> + testFile]]> - - $this->testFile + + testFile]]> - + 1234 1234 - - $this->newDir - $this->newDir - $this->newDirFile - $this->newFile - $this->newFile - $this->newFile - $this->newFile - $this->newFile - $this->newFile - $this->newFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->oldFile - $this->origFile - $this->tmpPath + + newDir]]> + newDir]]> + newDirFile]]> + newFile]]> + newFile]]> + newFile]]> + newFile]]> + newFile]]> + newFile]]> + newFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + oldFile]]> + origFile]]> + tmpPath]]> - - $this->tmpPath - $this->tmpPath + + tmpPath]]> + tmpPath]]> - + 1234 - - $filter($this->sourceFile) - $filter($this->sourceFile) - $filter($this->sourceFile) - $filter($this->sourceFile) + + sourceFile)]]> + sourceFile)]]> + sourceFile)]]> + sourceFile)]]> $firstResult - + $firstResult - - $oldFilePathInfo['extension'] - $oldFilePathInfo['extension'] + + + - + $input - + returnUnfilteredDataProvider - + $aliases - + getServiceLocator - + $container $value $value - - static fn($value) => $value - static fn($value) => $value + + $value]]> + $value]]> - + testFactoryConfiguresPluginManagerUnderServiceManagerV2 - + $container - + $rule $rule - + $inflector - + _testOptions - - $options['rules'][':action'] - $options['rules'][':controller'] - $rules['controller'] - $rules['controller'] + + + + + - + $rule $rule - + $filtered $filtered $filtered $rules - + getPluginManager getRules getTarget getTargetReplacementIdentifier isThrowTargetExceptionsOn - + $rule - + $rules $rules $rules @@ -1660,131 +1682,115 @@ $rules $rules - - $rules['controller'] - $rules['controller'] - $rules['suffix'] + + + + $rules[0] $rules[0] $rules[0] $rules[1] - + UnusedVariable - + $filtered $rule $target - + PregReplaceFilter::hasPcreUnicodeSupport() - - ['unknown'] + + - - StaticFilter::execute('"O\'Reilly"', HtmlEntities::class, ['quotestyle' => ENT_COMPAT]) - StaticFilter::execute('"O\'Reilly"', HtmlEntities::class, ['quotestyle' => ENT_QUOTES]) - StaticFilter::execute('1234', 'UnknownFilter') - StaticFilter::execute('1a2b3c4d', Digits::class) - StaticFilter::execute('foo', 'doStuff') - StaticFilter::getPluginManager() - StaticFilter::getPluginManager() - StaticFilter::getPluginManager() - StaticFilter::getPluginManager() - StaticFilter::setPluginManager($plugins) - StaticFilter::setPluginManager($plugins) - StaticFilter::setPluginManager($plugins) - StaticFilter::setPluginManager(null) - StaticFilter::setPluginManager(null) - - + $value $value - + $filteredValue - + $value $value - - $filter('sample') + + $prefix - - $filter('sample') + + $suffix - + setMethods - - $e->getMessage() + + getMessage()]]> - + setMethods - + $filtered $input - + $filtered - + $value - + $value - + $value - + $type - + true - + $value $value $value - + $expected $expected $value $value - + $data $data $type @@ -1793,13 +1799,13 @@ - + $filtered $filtered - + $filtered $filtered $filtered @@ -1808,7 +1814,7 @@ - + $filtered $filtered $filtered @@ -1818,13 +1824,13 @@ - + $element - + $value - + (array) $value (array) $value diff --git a/src/Encrypt/Openssl.php b/src/Encrypt/Openssl.php index acf2177c..e5842d9b 100644 --- a/src/Encrypt/Openssl.php +++ b/src/Encrypt/Openssl.php @@ -147,7 +147,7 @@ public function __construct($options = []) * * @internal * - * @param array $keys Key with type association + * @param array $keys Key with type association * @return $this * @throws Exception\InvalidArgumentException */ diff --git a/src/RealPath.php b/src/RealPath.php index 3d7cffe7..73ea9f22 100644 --- a/src/RealPath.php +++ b/src/RealPath.php @@ -38,7 +38,7 @@ class RealPath extends AbstractFilter ]; /** - * @param bool|Traversable $existsOrOptions Options to set + * @param bool|Traversable|Options $existsOrOptions Options to set */ public function __construct($existsOrOptions = true) { diff --git a/src/UriNormalize.php b/src/UriNormalize.php index 6cdc47d6..6ca48927 100644 --- a/src/UriNormalize.php +++ b/src/UriNormalize.php @@ -9,6 +9,8 @@ use Laminas\Uri\UriFactory; use Traversable; +use function assert; +use function count; use function explode; use function is_scalar; use function str_contains; @@ -137,7 +139,9 @@ protected function enforceScheme(Uri $uri) $path = $uri->getPath() ?? ''; if (str_contains($path, '/')) { - [$host, $path] = explode('/', $path, 2); + $parts = explode('/', $path, 2); + assert(count($parts) >= 2); + [$host, $path] = $parts; $path = '/' . $path; } else { $host = $path; diff --git a/test/BooleanTest.php b/test/BooleanTest.php index ee5f9618..9698730e 100644 --- a/test/BooleanTest.php +++ b/test/BooleanTest.php @@ -119,7 +119,7 @@ public function testSettingFalseType(): void $filter = new BooleanFilter(); $this->expectException(Exception\InvalidArgumentException::class); $this->expectExceptionMessage('Unknown type value'); - /** @psalm-suppress InvalidScalarArgument */ + /** @psalm-suppress InvalidArgument */ $filter->setType(true); } diff --git a/test/Compress/RarTest.php b/test/Compress/RarTest.php index ba3f9959..079e37e3 100644 --- a/test/Compress/RarTest.php +++ b/test/Compress/RarTest.php @@ -22,6 +22,7 @@ use const DIRECTORY_SEPARATOR; +/** @psalm-suppress DeprecatedClass */ class RarTest extends TestCase { public string $tmp; diff --git a/test/File/RenameTest.php b/test/File/RenameTest.php index 49425589..20ece7b5 100644 --- a/test/File/RenameTest.php +++ b/test/File/RenameTest.php @@ -352,6 +352,9 @@ public function testConstructTruncatedSourceDirectory(): void public function testAddSameFileAgainAndOverwriteExistingTarget(): void { + self::assertIsString($this->oldFile); + self::assertIsString($this->newFile); + $filter = new FileRename([ 'source' => $this->oldFile, 'target' => $this->newDir, diff --git a/test/FilterPluginManagerCompatibilityTest.php b/test/FilterPluginManagerCompatibilityTest.php index 713acc30..35566a40 100644 --- a/test/FilterPluginManagerCompatibilityTest.php +++ b/test/FilterPluginManagerCompatibilityTest.php @@ -66,8 +66,7 @@ public function aliasProvider(): Generator { $pluginManager = $this->getPluginManager(); $r = new ReflectionProperty($pluginManager, 'aliases'); - $r->setAccessible(true); - $aliases = $r->getValue($pluginManager); + $aliases = $r->getValue($pluginManager); foreach ($aliases as $alias => $target) { self::assertIsString($alias); diff --git a/test/FilterPluginManagerFactoryTest.php b/test/FilterPluginManagerFactoryTest.php index b6d3b46a..e52ba299 100644 --- a/test/FilterPluginManagerFactoryTest.php +++ b/test/FilterPluginManagerFactoryTest.php @@ -30,7 +30,6 @@ public function testFactoryReturnsPluginManager(): void // laminas-servicemanager v3 $r = new ReflectionObject($filters); $p = $r->getProperty('creationContext'); - $p->setAccessible(true); self::assertSame($container, $p->getValue($filters)); } else { // laminas-servicemanager v2 diff --git a/test/StaticFilterTest.php b/test/StaticFilterTest.php index cb3a5b75..5126d840 100644 --- a/test/StaticFilterTest.php +++ b/test/StaticFilterTest.php @@ -18,6 +18,9 @@ use const ENT_COMPAT; use const ENT_QUOTES; +/** + * @psalm-suppress DeprecatedClass + */ class StaticFilterTest extends TestCase { /** diff --git a/test/Word/CamelCaseToSeparatorNoPcreUnicodeTest.php b/test/Word/CamelCaseToSeparatorNoPcreUnicodeTest.php index 29eaf6da..5205f50f 100644 --- a/test/Word/CamelCaseToSeparatorNoPcreUnicodeTest.php +++ b/test/Word/CamelCaseToSeparatorNoPcreUnicodeTest.php @@ -22,7 +22,6 @@ public function setUp(): void } $this->reflection = new ReflectionProperty(StringUtils::class, 'hasPcreUnicodeSupport'); - $this->reflection->setAccessible(true); $this->reflection->setValue(false); } From e92b406c9ef54013f3ac80bb65ce9ecc0736dfa7 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 19:39:14 +0100 Subject: [PATCH 03/16] Bump `servicemanager` to 3.21 to fix plugin manager compatibility test (inherited static method is non-static) Signed-off-by: George Steel --- composer.json | 2 +- composer.lock | 2 +- test/FilterPluginManagerCompatibilityTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index fd11a4d9..955e567e 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "require": { "php": "~8.1.0 || ~8.2.0", "ext-mbstring": "*", - "laminas/laminas-servicemanager": "^3.14.0", + "laminas/laminas-servicemanager": "^3.21.0", "laminas/laminas-stdlib": "^3.13.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index bf629324..2077b309 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f94fd68c5868ed8c7a93ac287998405f", + "content-hash": "76faaa06c6163f55029c111d36ae95c0", "packages": [ { "name": "laminas/laminas-servicemanager", diff --git a/test/FilterPluginManagerCompatibilityTest.php b/test/FilterPluginManagerCompatibilityTest.php index 35566a40..18bfe37c 100644 --- a/test/FilterPluginManagerCompatibilityTest.php +++ b/test/FilterPluginManagerCompatibilityTest.php @@ -46,7 +46,7 @@ class FilterPluginManagerCompatibilityTest extends TestCase 'zendfilterfileencrypt', ]; - protected function getPluginManager(): FilterPluginManager + protected static function getPluginManager(): FilterPluginManager { return new FilterPluginManager(new ServiceManager()); } From 0125115cc2529abf033cdc4c06b421f34c4a8d91 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 19:55:00 +0100 Subject: [PATCH 04/16] Update psalm defaults Fixes as many errors as possible. Baselines unused code issues Signed-off-by: George Steel --- psalm-baseline.xml | 176 +++++++++++++++----- psalm.xml | 23 +-- test/Compress/RarTest.php | 4 +- test/Compress/SnappyTest.php | 7 - test/InflectorTest.php | 28 +++- test/StaticAnalysis/BooleanFilterChecks.php | 1 + test/StaticAnalysis/PluginRetrievalTest.php | 1 + test/_files/TestNamespace/MyDigits.php | 14 -- test/_files/TestNamespace/StringEquals.php | 50 ------ 9 files changed, 165 insertions(+), 139 deletions(-) delete mode 100644 test/_files/TestNamespace/MyDigits.php delete mode 100644 test/_files/TestNamespace/StringEquals.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 3d790d14..4cd4950e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -4,6 +4,10 @@ filterable + + setNullOnAllEmpty + setNullOnEmpty + $expectedInputs @@ -41,6 +45,10 @@ + + setList + setStrict + (bool) $strict @@ -70,6 +78,12 @@ options['translations']]]> options['type']]]> + + getTranslations + + + $constants + (bool) $flag @@ -98,6 +112,9 @@ $callbackOrOptions + + getCallback + (array) $params @@ -220,6 +237,9 @@ $content $content + + $options + @@ -270,6 +290,9 @@ $content $content + + $options + snappy_compress($content) snappy_uncompress($content) @@ -383,6 +406,13 @@ options['prefixes']]]> options['unit']]]> + + isDecimalMode + setMode + setPrecision + setPrefixes + setUnit + (int) $precision (string) $unit @@ -437,13 +467,16 @@ + + setList + setStrict + (bool) $strict - Encrypt Encrypt\EncryptionAlgorithmInterface @@ -487,6 +520,11 @@ $value + + __call + getAdapter + getAdapterInstance + @@ -549,6 +587,13 @@ $compression + + __construct + getCompression + getEncryption + getKey + getVector + $compression @@ -559,6 +604,13 @@ setSalt + + + decrypt + encrypt + toString + + Openssl @@ -609,6 +661,16 @@ keys]]> + + __construct + getCompression + getPackage + getPrivateKey + getPublicKey + setEnvelopeKey + setPrivateKey + setPublicKey + (bool) $package @@ -622,9 +684,6 @@ Filter\Decrypt parent::filter($content) - - Decrypt - @@ -665,6 +724,10 @@ $uploadData + + getFilename + setFilename + $filename @@ -677,9 +740,6 @@ Filter\Encrypt parent::filter($content) - - Encrypt - @@ -719,6 +779,10 @@ $uploadData + + getFilename + setFilename + $filename @@ -897,6 +961,15 @@ options['use_upload_extension']]]> options['use_upload_name']]]> + + setOverwrite + setRandomize + setUseUploadExtension + setUseUploadName + + + bool + (bool) $flag (bool) $flag @@ -941,6 +1014,9 @@ $options + + plugin + strtolower @@ -985,6 +1061,12 @@ $name + + validatePlugin + + + $shareByDefault + Alnum Alnum @@ -1036,6 +1118,11 @@ $container + + + FilterProviderInterface + + is_array($options) @@ -1123,6 +1210,13 @@ $source + + $reference + $target + + + self + $pluginManager $target @@ -1142,9 +1236,15 @@ getConfig + + $moduleManager + ModuleManager + + Module + @@ -1165,6 +1265,9 @@ options['replacement']]]> options['replacement']]]> + + bool + @@ -1268,6 +1371,9 @@ options['type']]]> + + $constants + is_int($value) @@ -1293,6 +1399,10 @@ $defaultScheme + + setDefaultScheme + setEnforcedScheme + @@ -1307,6 +1417,9 @@ $separator + + getSeparator + @@ -1357,6 +1470,10 @@ + + __construct + setCreationOptions + @@ -1432,6 +1549,9 @@ + + objectCallbackWithParams + @@ -1462,15 +1582,9 @@ - - true - - - unknown - - - unknown - + + bool + @@ -1485,10 +1599,6 @@ expectError expectErrorMessage - - $errno - $errstr - @@ -1603,6 +1713,11 @@ returnUnfilteredDataProvider + + + staticUcaseFilter + + $aliases @@ -1682,15 +1797,6 @@ $rules $rules - - - - - $rules[0] - $rules[0] - $rules[0] - $rules[1] - UnusedVariable @@ -1823,16 +1929,4 @@ $filtered - - - $element - - - $value - - - (array) $value - (array) $value - - diff --git a/psalm.xml b/psalm.xml index 71952285..c8a22a2f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,11 +2,14 @@ + errorBaseline="psalm-baseline.xml" + findUnusedPsalmSuppress="true" + findUnusedBaselineEntry="true" + findUnusedCode="true" +> @@ -15,22 +18,6 @@ - - - - - - - - - - - - - - - - diff --git a/test/Compress/RarTest.php b/test/Compress/RarTest.php index 079e37e3..10492602 100644 --- a/test/Compress/RarTest.php +++ b/test/Compress/RarTest.php @@ -282,10 +282,8 @@ public function testRarToString(): void /** * Test callback for compression - * - * @return unknown */ - public static function rarCompress() + public static function rarCompress(): bool { return true; } diff --git a/test/Compress/SnappyTest.php b/test/Compress/SnappyTest.php index b039ebab..61f272a5 100644 --- a/test/Compress/SnappyTest.php +++ b/test/Compress/SnappyTest.php @@ -97,11 +97,4 @@ public function testSnappyToString(): void $filter = new SnappyCompression(); self::assertSame('Snappy', $filter->toString()); } - - /** - * Null error handler; used when wanting to ignore specific error types - */ - public function errorHandler($errno, $errstr): void - { - } } diff --git a/test/InflectorTest.php b/test/InflectorTest.php index 696cbdea..f03c23b6 100644 --- a/test/InflectorTest.php +++ b/test/InflectorTest.php @@ -25,12 +25,10 @@ class InflectorTest extends TestCase { private InflectorFilter $inflector; - protected FilterPluginManager $broker; public function setUp(): void { $this->inflector = new InflectorFilter(); - $this->broker = $this->inflector->getPluginManager(); } public function testGetPluginManagerReturnsFilterManagerByDefault(): void @@ -71,7 +69,8 @@ public function testSetTargetByReferenceWorks(): void $target = 'foo/:bar/:baz'; $this->inflector->setTargetReference($target); self::assertSame('foo/:bar/:baz', $this->inflector->getTarget()); - /** @psalm-suppress UnusedVariable this variable is used by-ref through `setTargetReference` above */ + /* this variable is used by-ref through `setTargetReference` above */ + /** @psalm-suppress UnusedVariable */ $target .= '/:bat'; self::assertSame('foo/:bar/:baz/:bat', $this->inflector->getTarget()); } @@ -79,9 +78,11 @@ public function testSetTargetByReferenceWorks(): void public function testSetFilterRuleWithStringRuleCreatesRuleEntryAndFilterObject(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->setFilterRule('controller', PregReplace::class); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); self::assertSame(1, count($rules)); $filter = $rules[0]; self::assertInstanceOf(FilterInterface::class, $filter); @@ -90,10 +91,12 @@ public function testSetFilterRuleWithStringRuleCreatesRuleEntryAndFilterObject() public function testSetFilterRuleWithFilterObjectCreatesRuleEntryWithFilterObject(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $filter = new PregReplace(); $this->inflector->setFilterRule('controller', $filter); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); self::assertSame(1, count($rules)); $received = $rules[0]; self::assertInstanceOf(FilterInterface::class, $received); @@ -103,9 +106,11 @@ public function testSetFilterRuleWithFilterObjectCreatesRuleEntryWithFilterObjec public function testAddFilterRuleAppendsRuleEntries(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->setFilterRule('controller', [PregReplace::class, TestAsset\Alpha::class]); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); self::assertSame(2, count($rules)); self::assertInstanceOf(FilterInterface::class, $rules[0]); self::assertInstanceOf(FilterInterface::class, $rules[1]); @@ -114,9 +119,11 @@ public function testAddFilterRuleAppendsRuleEntries(): void public function testSetStaticRuleCreatesScalarRuleEntry(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->setStaticRule('controller', 'foobar'); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); } @@ -124,13 +131,16 @@ public function testSetStaticRuleCreatesScalarRuleEntry(): void public function testSetStaticRuleMultipleTimesOverwritesEntry(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->setStaticRule('controller', 'foobar'); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); $this->inflector->setStaticRule('controller', 'bazbat'); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('bazbat', $rules); } @@ -139,13 +149,16 @@ public function testSetStaticRuleReferenceAllowsUpdatingRuleByReference(): void { $rule = 'foobar'; $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->setStaticRuleReference('controller', $rule); $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); $rule .= '/baz'; $rules = $this->inflector->getRules('controller'); + self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar/baz', $rules); } @@ -153,12 +166,14 @@ public function testSetStaticRuleReferenceAllowsUpdatingRuleByReference(): void public function testAddRulesCreatesAppropriateRuleEntries(): void { $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(0, count($rules)); $this->inflector->addRules([ ':controller' => [PregReplace::class, TestAsset\Alpha::class], 'suffix' => 'phtml', ]); $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(2, count($rules)); self::assertSame(2, count($rules['controller'])); self::assertSame('phtml', $rules['suffix']); @@ -168,15 +183,16 @@ public function testSetRulesCreatesAppropriateRuleEntries(): void { $this->inflector->setStaticRule('some-rules', 'some-value'); $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(1, count($rules)); $this->inflector->setRules([ ':controller' => [PregReplace::class, TestAsset\Alpha::class], 'suffix' => 'phtml', ]); $rules = $this->inflector->getRules(); + self::assertIsArray($rules); self::assertSame(2, count($rules)); self::assertSame(2, count($rules['controller'])); - /** @psalm-suppress PossiblyInvalidArrayAccess */ self::assertSame('phtml', $rules['suffix']); } @@ -205,14 +221,14 @@ public function testFilterTransformsStringAccordingToRules(): void self::assertSame('Foo-Bar/baz-Bat.phtml', $filtered); } - public function testTargetReplacementIdentiferAccessorsWork(): void + public function testTargetReplacementIdentifierAccessorsWork(): void { self::assertSame(':', $this->inflector->getTargetReplacementIdentifier()); $this->inflector->setTargetReplacementIdentifier('?='); self::assertSame('?=', $this->inflector->getTargetReplacementIdentifier()); } - public function testTargetReplacementIdentiferWorksWhenInflected(): void + public function testTargetReplacementIdentifierWorksWhenInflected(): void { $inflector = new InflectorFilter( '?=##controller/?=##action.?=##suffix', diff --git a/test/StaticAnalysis/BooleanFilterChecks.php b/test/StaticAnalysis/BooleanFilterChecks.php index 43ad9f2a..92f6779a 100644 --- a/test/StaticAnalysis/BooleanFilterChecks.php +++ b/test/StaticAnalysis/BooleanFilterChecks.php @@ -6,6 +6,7 @@ use Laminas\Filter; +/** @psalm-suppress UnusedClass */ final class BooleanFilterChecks { public function constructorAcceptsSingleTypeConstant(): Filter\Boolean diff --git a/test/StaticAnalysis/PluginRetrievalTest.php b/test/StaticAnalysis/PluginRetrievalTest.php index 0b09d3c4..1f00fc14 100644 --- a/test/StaticAnalysis/PluginRetrievalTest.php +++ b/test/StaticAnalysis/PluginRetrievalTest.php @@ -7,6 +7,7 @@ use Laminas\Filter\FilterPluginManager; use Laminas\Filter\StringToUpper; +/** @psalm-suppress UnusedClass */ final class PluginRetrievalTest { public function __construct(private FilterPluginManager $pluginManager) diff --git a/test/_files/TestNamespace/MyDigits.php b/test/_files/TestNamespace/MyDigits.php deleted file mode 100644 index efc61a79..00000000 --- a/test/_files/TestNamespace/MyDigits.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Not all strings in the argument are equal', - ]; - - /** - * Defined by Laminas_Validate_Interface - * - * Returns true if and only if all the elements of the array argument - * are equal to one another with string comparison. - * - * @param array $value Value to validate - * @return bool - */ - public function isValid($value) - { - $this->setValue($value); - - $initial = (string) current((array) $value); - foreach ((array) $value as $element) { - if ((string) $element !== $initial) { - $this->error(self::NOT_EQUALS); - return false; - } - } - - return true; - } -} From c93ed0864c48756d45589fb4da4b5a87bc00cbc5 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 20:37:47 +0100 Subject: [PATCH 05/16] Upgrade PHPUnit 10.1.x Signed-off-by: George Steel --- .gitignore | 2 +- composer.json | 2 +- composer.lock | 582 +++++++++++++++++++---------------------------- phpunit.xml.dist | 45 ++-- 4 files changed, 255 insertions(+), 376 deletions(-) diff --git a/.gitignore b/.gitignore index 79ece404..bc53d92d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/.phpunit.result.cache +/.phpunit.cache /.phpcs-cache /.psalm-cache /docs/html/ diff --git a/composer.json b/composer.json index 955e567e..3d4c243c 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "laminas/laminas-crypt": "^3.10", "laminas/laminas-uri": "^2.10", "pear/archive_tar": "^1.4.14", - "phpunit/phpunit": "^9.6.8", + "phpunit/phpunit": "^10.1.3", "psalm/plugin-phpunit": "^0.18.4", "psr/http-factory": "^1.0.2", "vimeo/psalm": "^5.11" diff --git a/composer.lock b/composer.lock index 2077b309..edcc4158 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "76faaa06c6163f55029c111d36ae95c0", + "content-hash": "acd4e7c9182a55d8845553064615b68c", "packages": [ { "name": "laminas/laminas-servicemanager", @@ -775,76 +775,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -2125,16 +2055,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "10.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "884a0da7f9f46f28b2cb69134217fd810b793974" }, "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/884a0da7f9f46f28b2cb69134217fd810b793974", + "reference": "884a0da7f9f46f28b2cb69134217fd810b793974", "shasum": "" }, "require": { @@ -2142,18 +2072,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -2162,7 +2092,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -2190,7 +2120,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.1" }, "funding": [ { @@ -2198,32 +2129,32 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-04-17T12:15:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "5647d65443818959172645e7ed999217360654b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", + "reference": "5647d65443818959172645e7ed999217360654b6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2250,7 +2181,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" }, "funding": [ { @@ -2258,28 +2190,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-05-07T09:13:23+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -2287,7 +2219,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2313,7 +2245,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -2321,32 +2253,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2372,7 +2304,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" }, "funding": [ { @@ -2380,32 +2312,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-02-03T06:56:46+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2431,7 +2363,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -2439,24 +2371,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "10.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "2379ebafc1737e71cdc84f402acb6b7f04198b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2379ebafc1737e71cdc84f402acb6b7f04198b9d", + "reference": "2379ebafc1737e71cdc84f402acb6b7f04198b9d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -2466,27 +2397,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -2494,7 +2424,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -2526,7 +2456,7 @@ "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" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.3" }, "funding": [ { @@ -2542,7 +2472,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-05-11T05:16:22+00:00" }, { "name": "psalm/plugin-phpunit", @@ -2764,28 +2694,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2808,7 +2738,7 @@ "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" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -2816,32 +2746,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2864,7 +2794,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -2872,32 +2802,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2919,7 +2849,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -2927,34 +2857,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2993,7 +2925,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" }, "funding": [ { @@ -3001,33 +2933,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-02-03T07:07:16+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -3050,7 +2982,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" }, "funding": [ { @@ -3058,33 +2990,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-02-03T06:59:47+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3116,7 +3048,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -3124,27 +3057,27 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -3152,7 +3085,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3171,7 +3104,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -3179,7 +3112,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -3187,34 +3121,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3256,7 +3190,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" }, "funding": [ { @@ -3264,38 +3198,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-02-03T07:06:49+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "aab257c712de87b90194febd52e4d184551c2d44" }, "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/aab257c712de87b90194febd52e4d184551c2d44", + "reference": "aab257c712de87b90194febd52e4d184551c2d44", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3320,7 +3251,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" }, "funding": [ { @@ -3328,33 +3259,33 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-02-03T07:07:38+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -3377,7 +3308,7 @@ "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" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" }, "funding": [ { @@ -3385,34 +3316,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-02-03T07:08:02+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3434,7 +3365,7 @@ "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" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -3442,32 +3373,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -3489,7 +3420,7 @@ "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" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -3497,32 +3428,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3552,62 +3483,7 @@ "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", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "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" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -3615,32 +3491,32 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3663,7 +3539,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -3671,29 +3547,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3716,7 +3592,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -3724,7 +3600,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "slevomat/coding-standard", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 42d8d17a..a6f37dc2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,33 +1,36 @@ - - - ./src - - - - src/Int.php - src/Null.php - - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" + bootstrap="vendor/autoload.php" + colors="true" + cacheDirectory=".phpunit.cache" + displayDetailsOnIncompleteTests="true" + displayDetailsOnSkippedTests="true" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" + failOnDeprecation="true" + failOnWarning="true" + failOnNotice="true" +> ./test - + Some tests are problematic, largely due to environment. + Specifically, the Zip compression filter has this issue. These + tests are enabled by default; set them to false to disable them. + --> + + + ./src + + From 77f0c8a35385e39540a72a98f64406bdbc79ea9a Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 20:38:31 +0100 Subject: [PATCH 06/16] Rename SA test without `Test` suffix to avoid PHPUnit Errors Signed-off-by: George Steel --- .../{PluginRetrievalTest.php => PluginRetrieval.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/StaticAnalysis/{PluginRetrievalTest.php => PluginRetrieval.php} (95%) diff --git a/test/StaticAnalysis/PluginRetrievalTest.php b/test/StaticAnalysis/PluginRetrieval.php similarity index 95% rename from test/StaticAnalysis/PluginRetrievalTest.php rename to test/StaticAnalysis/PluginRetrieval.php index 1f00fc14..1778fde3 100644 --- a/test/StaticAnalysis/PluginRetrievalTest.php +++ b/test/StaticAnalysis/PluginRetrieval.php @@ -8,7 +8,7 @@ use Laminas\Filter\StringToUpper; /** @psalm-suppress UnusedClass */ -final class PluginRetrievalTest +final class PluginRetrieval { public function __construct(private FilterPluginManager $pluginManager) { From a983c7aefef45a289834ef29db3ec83e98048672 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 20:39:18 +0100 Subject: [PATCH 07/16] Revert incorrect assertions that fail tests because of by-ref behaviour Signed-off-by: George Steel --- test/InflectorTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/InflectorTest.php b/test/InflectorTest.php index f03c23b6..0d6de335 100644 --- a/test/InflectorTest.php +++ b/test/InflectorTest.php @@ -123,7 +123,6 @@ public function testSetStaticRuleCreatesScalarRuleEntry(): void self::assertSame(0, count($rules)); $this->inflector->setStaticRule('controller', 'foobar'); $rules = $this->inflector->getRules('controller'); - self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); } @@ -135,12 +134,10 @@ public function testSetStaticRuleMultipleTimesOverwritesEntry(): void self::assertSame(0, count($rules)); $this->inflector->setStaticRule('controller', 'foobar'); $rules = $this->inflector->getRules('controller'); - self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); $this->inflector->setStaticRule('controller', 'bazbat'); $rules = $this->inflector->getRules('controller'); - self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('bazbat', $rules); } @@ -153,12 +150,10 @@ public function testSetStaticRuleReferenceAllowsUpdatingRuleByReference(): void self::assertSame(0, count($rules)); $this->inflector->setStaticRuleReference('controller', $rule); $rules = $this->inflector->getRules('controller'); - self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar', $rules); $rule .= '/baz'; $rules = $this->inflector->getRules('controller'); - self::assertIsArray($rules); /** @psalm-suppress DocblockTypeContradiction */ self::assertSame('foobar/baz', $rules); } From e27b470a052e2438ac012a3a885c44dd5ae562fc Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 20:40:53 +0100 Subject: [PATCH 08/16] Extract callbacks into a separate class. TestCases can not be constructed outside of the framework anymore. Signed-off-by: George Steel --- test/CallbackTest.php | 33 +++++++------------------------- test/TestAsset/CallbackClass.php | 28 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 test/TestAsset/CallbackClass.php diff --git a/test/CallbackTest.php b/test/CallbackTest.php index fa0d67ee..4779de68 100644 --- a/test/CallbackTest.php +++ b/test/CallbackTest.php @@ -5,20 +5,21 @@ namespace LaminasTest\Filter; use Laminas\Filter\Callback as CallbackFilter; +use LaminasTest\Filter\TestAsset\CallbackClass; use PHPUnit\Framework\TestCase; class CallbackTest extends TestCase { public function testObjectCallback(): void { - $filter = new CallbackFilter([$this, 'objectCallback']); + $filter = new CallbackFilter([new CallbackClass(), 'objectCallback']); self::assertSame('objectCallback-test', $filter('test')); } public function testConstructorWithOptions(): void { $filter = new CallbackFilter([ - 'callback' => [$this, 'objectCallbackWithParams'], + 'callback' => [new CallbackClass(), 'objectCallbackWithParams'], 'callback_params' => 0, ]); @@ -28,27 +29,27 @@ public function testConstructorWithOptions(): void public function testStaticCallback(): void { $filter = new CallbackFilter( - [self::class, 'staticCallback'] + [CallbackClass::class, 'staticCallback'] ); self::assertSame('staticCallback-test', $filter('test')); } public function testStringClassCallback(): void { - $filter = new CallbackFilter(self::class); + $filter = new CallbackFilter(CallbackClass::class); self::assertSame('stringClassCallback-test', $filter('test')); } public function testSettingDefaultOptions(): void { - $filter = new CallbackFilter([$this, 'objectCallback'], 'param'); + $filter = new CallbackFilter([new CallbackClass(), 'objectCallback'], 'param'); self::assertSame(['param'], $filter->getCallbackParams()); self::assertSame('objectCallback-test', $filter('test')); } public function testSettingDefaultOptionsAfterwards(): void { - $filter = new CallbackFilter([$this, 'objectCallback']); + $filter = new CallbackFilter([new CallbackClass(), 'objectCallback']); $filter->setCallbackParams('param'); self::assertSame(['param'], $filter->getCallbackParams()); self::assertSame('objectCallback-test', $filter('test')); @@ -65,24 +66,4 @@ public function testCallbackWithArrayParameters(): void $filter = new CallbackFilter('strrev'); self::assertSame('!olleH', $filter('Hello!')); } - - public function objectCallback(string $value): string - { - return 'objectCallback-' . $value; - } - - public static function staticCallback(string $value): string - { - return 'staticCallback-' . $value; - } - - public function __invoke(string $value): string - { - return 'stringClassCallback-' . $value; - } - - public function objectCallbackWithParams(string $value, int|string|null $param = null): string - { - return 'objectCallbackWithParams-' . $value . '-' . (string) $param; - } } diff --git a/test/TestAsset/CallbackClass.php b/test/TestAsset/CallbackClass.php new file mode 100644 index 00000000..145225ca --- /dev/null +++ b/test/TestAsset/CallbackClass.php @@ -0,0 +1,28 @@ + Date: Mon, 15 May 2023 20:42:24 +0100 Subject: [PATCH 09/16] TestCases can not be constructed outside of the framework anymore. Signed-off-by: George Steel --- test/FilterPluginManagerTest.php | 3 ++- test/TestAsset/NotAValidFilter.php | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/TestAsset/NotAValidFilter.php diff --git a/test/FilterPluginManagerTest.php b/test/FilterPluginManagerTest.php index 7d52af0b..d638e7a7 100644 --- a/test/FilterPluginManagerTest.php +++ b/test/FilterPluginManagerTest.php @@ -10,6 +10,7 @@ use Laminas\Filter\Word\SeparatorToSeparator; use Laminas\ServiceManager\Exception\InvalidServiceException; use Laminas\ServiceManager\ServiceManager; +use LaminasTest\Filter\TestAsset\NotAValidFilter; use PHPUnit\Framework\TestCase; use Throwable; @@ -39,7 +40,7 @@ public function testRegisteringInvalidFilterRaisesException(): void public function testLoadingInvalidFilterRaisesException(): void { - $this->filters->setInvokableClass('test', static::class); + $this->filters->setInvokableClass('test', NotAValidFilter::class); $this->expectException($this->getInvalidServiceException()); $this->filters->get('test'); } diff --git a/test/TestAsset/NotAValidFilter.php b/test/TestAsset/NotAValidFilter.php new file mode 100644 index 00000000..332412a6 --- /dev/null +++ b/test/TestAsset/NotAValidFilter.php @@ -0,0 +1,9 @@ + Date: Mon, 15 May 2023 20:48:36 +0100 Subject: [PATCH 10/16] Probable fix for untestable test-case: PHPUnit methods `expectError` and `expectErrorMessage` no longer exist. Signed-off-by: George Steel --- test/Compress/SnappyTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Compress/SnappyTest.php b/test/Compress/SnappyTest.php index 61f272a5..814c1a52 100644 --- a/test/Compress/SnappyTest.php +++ b/test/Compress/SnappyTest.php @@ -4,6 +4,7 @@ namespace LaminasTest\Filter\Compress; +use Error; use Laminas\Filter\Compress\Snappy as SnappyCompression; use Laminas\Filter\Exception; use PHPUnit\Framework\TestCase; @@ -39,8 +40,8 @@ public function testBasicUsage(): void public function testANonStringWillYieldATypeErrorDuringCompression(): void { - $this->expectError(); - $this->expectErrorMessage('snappy_compress : expects parameter to be string'); + $this->expectException(Error::class); + $this->expectExceptionMessage('snappy_compress : expects parameter to be string'); /** @psalm-suppress InvalidArgument, InvalidCast */ (new SnappyCompression())->compress([]); } From 12a9b62447b77a2158bbea999159319b6a93365b Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 20:53:02 +0100 Subject: [PATCH 11/16] Remove tests that cover internal behaviour using removed PHPUnit mocking methods Signed-off-by: George Steel --- test/StringToLowerTest.php | 14 -------------- test/StringToUpperTest.php | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/test/StringToLowerTest.php b/test/StringToLowerTest.php index d92b919f..a97c3b40 100644 --- a/test/StringToLowerTest.php +++ b/test/StringToLowerTest.php @@ -142,18 +142,4 @@ public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, $this->filter->filter($input)); } - - /** - * @group 7147 - */ - public function testFilterUsesGetEncodingMethod(): void - { - $filterMock = $this->getMockBuilder(StringToLowerFilter::class) - ->setMethods(['getEncoding']) - ->getMock(); - $filterMock->expects($this->once()) - ->method('getEncoding') - ->with(); - $filterMock->filter('foo'); - } } diff --git a/test/StringToUpperTest.php b/test/StringToUpperTest.php index 52c40448..32e2cfa0 100644 --- a/test/StringToUpperTest.php +++ b/test/StringToUpperTest.php @@ -138,18 +138,4 @@ public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, $this->filter->filter($input)); } - - /** - * @group 7147 - */ - public function testFilterUsesGetEncodingMethod(): void - { - $filterMock = $this->getMockBuilder(StringToUpperFilter::class) - ->setMethods(['getEncoding']) - ->getMock(); - $filterMock->expects($this->once()) - ->method('getEncoding') - ->with(); - $filterMock->filter('foo'); - } } From 40b4c1af5133d0faf29e1398c1808d304aef99d4 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 15 May 2023 21:32:19 +0100 Subject: [PATCH 12/16] Migrate tests for PHPUnit 10 compatibility - All data providers made static - Change doc blocks to attributes Signed-off-by: George Steel --- psalm-baseline.xml | 232 ++++++++++++++---- test/AbstractUnicodeTest.php | 5 +- test/AllowListTest.php | 9 +- test/BaseNameTest.php | 7 +- test/BooleanTest.php | 15 +- test/Compress/ZipTest.php | 6 +- test/CompressTest.php | 37 ++- test/DataUnitFormatterTest.php | 9 +- test/DateSelectTest.php | 7 +- test/DateTimeFormatterTest.php | 7 +- test/DateTimeSelectTest.php | 7 +- test/DecompressTest.php | 26 +- test/DenyListTest.php | 9 +- test/DigitsTest.php | 7 +- test/DirTest.php | 7 +- test/File/LowerCaseTest.php | 17 +- test/File/RenameTest.php | 17 +- test/File/RenameUploadTest.php | 7 +- test/File/UpperCaseTest.php | 35 +-- test/FilterChainTest.php | 5 +- test/FilterPluginManagerCompatibilityTest.php | 5 +- test/FilterPluginManagerFactoryTest.php | 9 +- test/FilterPluginManagerTest.php | 9 +- test/HtmlEntitiesTest.php | 38 +-- test/InflectorTest.php | 17 +- test/MonthSelectTest.php | 7 +- test/PregReplaceTest.php | 13 +- test/RealPathTest.php | 7 +- test/StaticFilterTest.php | 4 +- test/StringPrefixTest.php | 7 +- test/StringSuffixTest.php | 7 +- test/StringToLowerTest.php | 12 +- test/StringToUpperTest.php | 12 +- test/StringTrimTest.php | 27 +- test/StripNewlinesTest.php | 13 +- test/StripTagsTest.php | 43 ++-- test/ToFloatTest.php | 12 +- test/ToIntTest.php | 7 +- test/ToNullTest.php | 16 +- test/UpperCaseWordsTest.php | 15 +- test/UriNormalizeTest.php | 15 +- test/Word/CamelCaseToSeparatorTest.php | 13 +- test/Word/DashToSeparatorTest.php | 13 +- test/Word/SeparatorToCamelCaseTest.php | 26 +- test/Word/SeparatorToSeparatorTest.php | 13 +- 45 files changed, 414 insertions(+), 417 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4cd4950e..9a1955be 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -477,6 +477,7 @@ + Encrypt Encrypt\EncryptionAlgorithmInterface @@ -684,6 +685,9 @@ Filter\Decrypt parent::filter($content) + + Decrypt + @@ -740,6 +744,9 @@ Filter\Encrypt parent::filter($content) + + Encrypt + @@ -1495,6 +1502,9 @@ class extends AbstractUnicode { + + encodingProvider + @@ -1508,6 +1518,15 @@ $data [$value, $expected] + + defaultTestProvider + listTestProvider + + + + + returnUnfilteredDataProvider + @@ -1537,21 +1556,19 @@ [$value, $expected] [$value, $expected] - - array - - - testTypes - + + combinedTypeTestProvider + defaultTestProvider + duplicateProvider + noCastingTestProvider + typeTestProvider + - - objectCallbackWithParams - @@ -1595,15 +1612,14 @@ new SnappyCompression() new SnappyCompression() - - expectError - expectErrorMessage - $compressed + + returnUnfilteredDataProvider + getArchive getArchive @@ -1612,6 +1628,27 @@ $adapter + + + binaryBytesTestProvider + decimalBytesTestProvider + + + + + provideFilter + + + + + returnUnfilteredDataProvider + + + + + provideFilter + + $compressed @@ -1623,6 +1660,9 @@ null + + returnUnfilteredDataProvider + @@ -1633,26 +1673,28 @@ $data [$value, $expected] + + defaultTestProvider + listTestProvider + + + + + returnUnfilteredDataProvider + + + + + returnUnfilteredDataProvider + $input - + returnUnfilteredDataProvider - - - testDir]]> - testDir]]> - testFile]]> - testFile]]> - testFile]]> - testFile]]> - testFile]]> - - - testFile]]> - + @@ -1685,6 +1727,9 @@ tmpPath]]> tmpPath]]> + + returnUnfilteredDataProvider + @@ -1704,25 +1749,23 @@ + + returnUnfilteredDataProvider + $input - + returnUnfilteredDataProvider - + staticUcaseFilter - - - $aliases - - getServiceLocator @@ -1743,6 +1786,11 @@ $container + + + returnUnfilteredDataProvider + + $rule @@ -1783,19 +1831,6 @@ $rules $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules - $rules UnusedVariable @@ -1806,15 +1841,27 @@ $target + + + provideFilter + + PregReplaceFilter::hasPcreUnicodeSupport() + + returnNonStringScalarValues + returnUnfilteredDataProvider + + + returnUnfilteredDataProvider + @@ -1834,25 +1881,42 @@ $prefix + + invalidPrefixesDataProvider + $suffix + + invalidSuffixesDataProvider + - - setMethods - getMessage()]]> + + returnUnfilteredDataProvider + - - setMethods - + + returnUnfilteredDataProvider + + + + + getNonStringValues + + + + + returnNonStringScalarValues + returnUnfilteredDataProvider + @@ -1862,12 +1926,21 @@ $filtered + + badCommentProvider + returnUnfilteredDataProvider + $value + + + objectCallbackWithParams + + $value @@ -1878,6 +1951,17 @@ $value + + + filterableValuesProvider + unfilterableValuesProvider + + + + + returnUnfilteredDataProvider + + $type @@ -1903,6 +1987,30 @@ [$value, $expected] [$value, $expected] + + combinedTypeTestProvider + defaultTestProvider + duplicateTypeProvider + typeTestProvider + + + + + returnUnfilteredDataProvider + + + + + abnormalUriProvider + enforcedSchemeTestcaseProvider + returnUnfilteredDataProvider + + + + + returnNonStringScalarValues + returnUnfilteredDataProvider + @@ -1910,6 +2018,24 @@ $filtered + + + returnNonStringScalarValues + returnUnfilteredDataProvider + + + + + returnNonStringScalarValues + returnUnfilteredDataProvider + + + + + returnNonStringScalarValues + returnUnfilteredDataProvider + + $filtered diff --git a/test/AbstractUnicodeTest.php b/test/AbstractUnicodeTest.php index bea4ae2c..7e9f549b 100644 --- a/test/AbstractUnicodeTest.php +++ b/test/AbstractUnicodeTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\AbstractUnicode; use Laminas\Filter\Exception\InvalidArgumentException; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function assert; @@ -32,7 +33,7 @@ public function filter($value): string } /** @return list */ - public function encodingProvider(): array + public static function encodingProvider(): array { return [ ['ISO-8859-16', 'iso-8859-16'], @@ -41,7 +42,7 @@ public function encodingProvider(): array ]; } - /** @dataProvider encodingProvider */ + #[DataProvider('encodingProvider')] public function testThatEncodingOptionIsLowerCased(string $encoding, string $expectedEncoding): void { $this->filter->setEncoding($encoding); diff --git a/test/AllowListTest.php b/test/AllowListTest.php index 5f4e4165..d22c3581 100644 --- a/test/AllowListTest.php +++ b/test/AllowListTest.php @@ -9,6 +9,7 @@ use Laminas\ServiceManager\ServiceManager; use Laminas\Stdlib\ArrayObject; use Laminas\Stdlib\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function gettype; @@ -70,18 +71,14 @@ public function testSetStrictShouldCastToBoolean(): void self::assertSame(true, $filter->getStrict()); } - /** - * @dataProvider defaultTestProvider - */ + #[DataProvider('defaultTestProvider')] public function testDefault(mixed $value): void { $filter = new AllowListFilter(); self::assertNull($filter->filter($value)); } - /** - * @dataProvider listTestProvider - */ + #[DataProvider('listTestProvider')] public function testList(bool $strict, array $list, array $testData): void { $filter = new AllowListFilter([ diff --git a/test/BaseNameTest.php b/test/BaseNameTest.php index 4f2406db..5f46ff9c 100644 --- a/test/BaseNameTest.php +++ b/test/BaseNameTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\BaseName as BaseNameFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -26,7 +27,7 @@ public function testBasic(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -40,9 +41,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new BaseNameFilter(); diff --git a/test/BooleanTest.php b/test/BooleanTest.php index 9698730e..ed8f31be 100644 --- a/test/BooleanTest.php +++ b/test/BooleanTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Boolean as BooleanFilter; use Laminas\Filter\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function gettype; @@ -33,18 +34,14 @@ public function testConstructorParams(): void self::assertFalse($filter->getCasting()); } - /** - * @dataProvider defaultTestProvider - */ + #[DataProvider('defaultTestProvider')] public function testDefault(mixed $value, bool $expected): void { $filter = new BooleanFilter(); self::assertSame($expected, $filter->filter($value)); } - /** - * @dataProvider noCastingTestProvider - */ + #[DataProvider('noCastingTestProvider')] public function testNoCasting(mixed $value, mixed $expected): void { $filter = new BooleanFilter('all', false); @@ -53,8 +50,8 @@ public function testNoCasting(mixed $value, mixed $expected): void /** * @param array{0: mixed, 1: mixed} $testData - * @dataProvider typeTestProvider */ + #[DataProvider('typeTestProvider')] public function testTypes(int $type, array $testData): void { $filter = new BooleanFilter($type); @@ -74,8 +71,8 @@ public function testTypes(int $type, array $testData): void /** * @param array $typeData * @param array $testData - * @dataProvider combinedTypeTestProvider */ + #[DataProvider('combinedTypeTestProvider')] public function testCombinedTypes($typeData, $testData): void { foreach ($typeData as $type) { @@ -134,8 +131,8 @@ public function testGettingDefaultType(): void * https://github.com/zendframework/zend-filter/issues/48 * * @param mixed $type Type to double initialize - * @dataProvider duplicateProvider */ + #[DataProvider('duplicateProvider')] public function testDuplicateTypesWorkProperly(int|string $type, int $expected): void { $filter = new BooleanFilter([$type, $type]); diff --git a/test/Compress/ZipTest.php b/test/Compress/ZipTest.php index 68076cce..47a1a86b 100644 --- a/test/Compress/ZipTest.php +++ b/test/Compress/ZipTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Compress\Zip as ZipCompression; use Laminas\Filter\Exception; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use function extension_loaded; @@ -292,10 +293,7 @@ public function testDecompressWillThrowExceptionWhenDecompressingWithNoTarget(): self::assertSame('compress me', $content); } - /** - * @group 6026 - * @covers \Laminas\Filter\Compress\Zip::decompress - */ + #[Group('6026')] public function testDecompressWhenNoArchieveInClass(): void { if (! getenv('TESTS_LAMINAS_FILTER_COMPRESS_ZIP_ENABLED')) { diff --git a/test/CompressTest.php b/test/CompressTest.php index f04a022e..e7a07020 100644 --- a/test/CompressTest.php +++ b/test/CompressTest.php @@ -8,6 +8,7 @@ use Laminas\Filter\Compress as CompressFilter; use Laminas\Filter\Compress\CompressionAlgorithmInterface; use Laminas\Filter\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -38,7 +39,7 @@ public function setUp(): void public function tearDown(): void { if (is_dir($this->tmpDir)) { - foreach ($this->returnFilterType() as $parameters) { + foreach (self::returnFilterType() as $parameters) { if (file_exists($this->tmpDir . '/compressed.' . $parameters[0])) { unlink($this->tmpDir . '/compressed.' . $parameters[0]); } @@ -48,7 +49,7 @@ public function tearDown(): void } /** @return iterable */ - public function returnFilterType(): iterable + public static function returnFilterType(): iterable { if (extension_loaded('bz2')) { yield ['bz2']; @@ -60,9 +61,8 @@ public function returnFilterType(): iterable /** * Basic usage - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testBasicUsage(string $filterType): void { $filter = new CompressFilter($filterType); @@ -77,9 +77,8 @@ public function testBasicUsage(string $filterType): void /** * Setting Options - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testGetSetAdapterOptionsInConstructor(string $filterType): void { $filter = new CompressFilter([ @@ -100,9 +99,8 @@ public function testGetSetAdapterOptionsInConstructor(string $filterType): void /** * Setting Options through constructor - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testGetSetAdapterOptions(string $filterType): void { $filter = new CompressFilter($filterType); @@ -138,9 +136,8 @@ public function testGetSetBlocksize(): void /** * Setting Archive - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testGetSetArchive(string $filterType): void { $filter = new CompressFilter($filterType); @@ -152,9 +149,8 @@ public function testGetSetArchive(string $filterType): void /** * Setting Archive - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testCompressToFile(string $filterType): void { $filter = new CompressFilter($filterType); @@ -176,9 +172,8 @@ public function testCompressToFile(string $filterType): void /** * testing toString - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testToString(string $filterType): void { $filter = new CompressFilter($filterType); @@ -187,9 +182,8 @@ public function testToString(string $filterType): void /** * testing getAdapter - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testGetAdapter(string $filterType): void { $filter = new CompressFilter($filterType); @@ -219,9 +213,8 @@ public function testSetAdapter(): void /** * Decompress archiv - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testDecompressArchive(string $filterType): void { $filter = new CompressFilter($filterType); @@ -249,9 +242,9 @@ public function testInvalidMethod(): void } /** @return iterable */ - public function returnUnfilteredDataProvider(): iterable + public static function returnUnfilteredDataProvider(): iterable { - foreach ($this->returnFilterType() as $parameters) { + foreach (self::returnFilterType() as $parameters) { yield [$parameters[0], null]; yield [$parameters[0], new stdClass()]; yield [ @@ -264,9 +257,7 @@ public function returnUnfilteredDataProvider(): iterable } } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(string $filterType, mixed $input): void { $filter = new CompressFilter($filterType); diff --git a/test/DataUnitFormatterTest.php b/test/DataUnitFormatterTest.php index 95922d80..ba127d33 100644 --- a/test/DataUnitFormatterTest.php +++ b/test/DataUnitFormatterTest.php @@ -6,13 +6,12 @@ use Laminas\Filter\DataUnitFormatter as DataUnitFormatterFilter; use Laminas\Filter\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DataUnitFormatterTest extends TestCase { - /** - * @dataProvider decimalBytesTestProvider - */ + #[DataProvider('decimalBytesTestProvider')] public function testDecimalBytes(float $value, string $expected): void { $filter = new DataUnitFormatterFilter([ @@ -22,9 +21,7 @@ public function testDecimalBytes(float $value, string $expected): void self::assertSame($expected, $filter->filter($value)); } - /** - * @dataProvider binaryBytesTestProvider - */ + #[DataProvider('binaryBytesTestProvider')] public function testBinaryBytes(float $value, string $expected): void { $filter = new DataUnitFormatterFilter([ diff --git a/test/DateSelectTest.php b/test/DateSelectTest.php index 843fa15d..9f1a780a 100644 --- a/test/DateSelectTest.php +++ b/test/DateSelectTest.php @@ -6,13 +6,12 @@ use Laminas\Filter\DateSelect as DateSelectFilter; use Laminas\Filter\Exception\RuntimeException; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DateSelectTest extends TestCase { - /** - * @dataProvider provideFilter - */ + #[DataProvider('provideFilter')] public function testFilter(array $options, array $input, ?string $expected): void { $sut = new DateSelectFilter(); @@ -21,7 +20,7 @@ public function testFilter(array $options, array $input, ?string $expected): voi } /** @return list */ - public function provideFilter(): array + public static function provideFilter(): array { return [ [[], ['year' => '2014', 'month' => '10', 'day' => '26'], '2014-10-26'], diff --git a/test/DateTimeFormatterTest.php b/test/DateTimeFormatterTest.php index a52d29fb..b77a2812 100644 --- a/test/DateTimeFormatterTest.php +++ b/test/DateTimeFormatterTest.php @@ -8,6 +8,7 @@ use DateTimeInterface; use Laminas\Filter\DateTimeFormatter; use Laminas\Filter\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -29,7 +30,7 @@ public function tearDown(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -45,9 +46,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { date_default_timezone_set('UTC'); diff --git a/test/DateTimeSelectTest.php b/test/DateTimeSelectTest.php index 0fe342e7..870dd816 100644 --- a/test/DateTimeSelectTest.php +++ b/test/DateTimeSelectTest.php @@ -6,13 +6,12 @@ use Laminas\Filter\DateTimeSelect as DateTimeSelectFilter; use Laminas\Filter\Exception\RuntimeException; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DateTimeSelectTest extends TestCase { - /** - * @dataProvider provideFilter - */ + #[DataProvider('provideFilter')] public function testFilter(array $options, array $input, ?string $expected): void { $sut = new DateTimeSelectFilter(); @@ -21,7 +20,7 @@ public function testFilter(array $options, array $input, ?string $expected): voi } /** @return list */ - public function provideFilter(): array + public static function provideFilter(): array { return [ [ diff --git a/test/DecompressTest.php b/test/DecompressTest.php index cafb4640..b68c58c8 100644 --- a/test/DecompressTest.php +++ b/test/DecompressTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\Decompress as DecompressFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -35,7 +36,7 @@ public function setUp(): void public function tearDown(): void { if (is_dir($this->tmpDir)) { - foreach ($this->returnFilterType() as $parameters) { + foreach (self::returnFilterType() as $parameters) { if (file_exists($this->tmpDir . '/compressed.' . $parameters[0])) { unlink($this->tmpDir . '/compressed.' . $parameters[0]); } @@ -45,7 +46,7 @@ public function tearDown(): void } /** @return iterable */ - public function returnFilterType(): iterable + public static function returnFilterType(): iterable { if (extension_loaded('bz2')) { yield ['bz2']; @@ -57,9 +58,8 @@ public function returnFilterType(): iterable /** * Basic usage - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testBasicUsage(string $filterType): void { $filter = new DecompressFilter($filterType); @@ -74,9 +74,8 @@ public function testBasicUsage(string $filterType): void /** * Setting Archive - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testCompressToFile(string $filterType): void { $filter = new DecompressFilter($filterType); @@ -98,9 +97,8 @@ public function testCompressToFile(string $filterType): void /** * Basic usage - * - * @dataProvider returnFilterType */ + #[DataProvider('returnFilterType')] public function testDecompressArchive(string $filterType): void { $filter = new DecompressFilter($filterType); @@ -115,9 +113,7 @@ public function testDecompressArchive(string $filterType): void self::assertSame('compress me', $content2); } - /** - * @dataProvider returnFilterType - */ + #[DataProvider('returnFilterType')] public function testFilterMethodProxiesToDecompress(string $filterType): void { $filter = new DecompressFilter($filterType); @@ -133,9 +129,9 @@ public function testFilterMethodProxiesToDecompress(string $filterType): void } /** @return iterable */ - public function returnUnfilteredDataProvider(): iterable + public static function returnUnfilteredDataProvider(): iterable { - foreach ($this->returnFilterType() as $parameter) { + foreach (self::returnFilterType() as $parameter) { yield [$parameter[0], new stdClass()]; yield [ $parameter[0], @@ -147,9 +143,7 @@ public function returnUnfilteredDataProvider(): iterable } } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(string $filterType, mixed $input): void { $filter = new DecompressFilter($filterType); diff --git a/test/DenyListTest.php b/test/DenyListTest.php index 540e8f9d..cd44d288 100644 --- a/test/DenyListTest.php +++ b/test/DenyListTest.php @@ -9,6 +9,7 @@ use Laminas\ServiceManager\ServiceManager; use Laminas\Stdlib\ArrayObject; use Laminas\Stdlib\Exception; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function gettype; @@ -70,18 +71,14 @@ public function testSetStrictShouldCastToBoolean(): void self::assertSame(true, $filter->getStrict()); } - /** - * @dataProvider defaultTestProvider - */ + #[DataProvider('defaultTestProvider')] public function testDefault(mixed $value, mixed $expected): void { $filter = new DenyListFilter(); self::assertSame($expected, $filter->filter($value)); } - /** - * @dataProvider listTestProvider - */ + #[DataProvider('listTestProvider')] public function testList(bool $strict, array $list, array $testData): void { $filter = new DenyListFilter([ diff --git a/test/DigitsTest.php b/test/DigitsTest.php index 56efd5b4..5ef791a0 100644 --- a/test/DigitsTest.php +++ b/test/DigitsTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\Digits as DigitsFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -71,7 +72,7 @@ public function testBasic(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -87,9 +88,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new DigitsFilter(); diff --git a/test/DirTest.php b/test/DirTest.php index b1e6cd9e..7b1eb91d 100644 --- a/test/DirTest.php +++ b/test/DirTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\Dir as DirFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -27,7 +28,7 @@ public function testBasic(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -41,9 +42,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new DirFilter(); diff --git a/test/File/LowerCaseTest.php b/test/File/LowerCaseTest.php index 0e92cd9c..74f0a55f 100644 --- a/test/File/LowerCaseTest.php +++ b/test/File/LowerCaseTest.php @@ -7,6 +7,7 @@ use Laminas\Filter\Exception; use Laminas\Filter\Exception\ExtensionNotLoadedException; use Laminas\Filter\File\LowerCase as FileLowerCase; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -21,8 +22,7 @@ class LowerCaseTest extends TestCase { - private ?string $testDir = null; - private ?string $testFile = null; + private string $testFile; /** * Sets the path to test files @@ -30,8 +30,7 @@ class LowerCaseTest extends TestCase public function setUp(): void { $source = dirname(__DIR__) . '/_files/testfile2.txt'; - $this->testDir = sys_get_temp_dir(); - $this->testFile = sprintf('%s/%s.txt', $this->testDir, uniqid('laminasilter')); + $this->testFile = sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid('laminasilter')); copy($source, $this->testFile); } @@ -94,23 +93,21 @@ public function testCheckSettingOfEncodingWithMethod(): void } } - public function returnUnfilteredDataProvider() + public static function returnUnfilteredDataProvider(): array { return [ [null], [new stdClass()], [ [ - sprintf('%s/%s.txt', $this->testDir, uniqid()), - sprintf('%s/%s.txt', $this->testDir, uniqid()), + sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid()), + sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid()), ], ], ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered($input): void { $filter = new FileLowerCase(); diff --git a/test/File/RenameTest.php b/test/File/RenameTest.php index 20ece7b5..2fa5f93d 100644 --- a/test/File/RenameTest.php +++ b/test/File/RenameTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Exception; use Laminas\Filter\File\Rename as FileRename; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -538,23 +539,27 @@ public function testInvalidConstruction(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { + $tmpPath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, uniqid('returnUnfilteredDataProvider')); + mkdir($tmpPath, 0775, true); + + $oldFile = sprintf('%s%stestfile.txt', $tmpPath, DIRECTORY_SEPARATOR); + $origFile = sprintf('%s%soriginal.file', $tmpPath, DIRECTORY_SEPARATOR); + return [ [null], [new stdClass()], [ [ - $this->oldFile, - $this->origFile, + $oldFile, + $origFile, ], ], ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new FileRename($this->newFile); diff --git a/test/File/RenameUploadTest.php b/test/File/RenameUploadTest.php index 9561cc0e..730ffcdd 100644 --- a/test/File/RenameUploadTest.php +++ b/test/File/RenameUploadTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Exception; use Laminas\Filter\File\RenameUpload as FileRenameUpload; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\StreamInterface; @@ -370,7 +371,7 @@ public function testCanFilterMultipleTimesWithSameResult(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -384,9 +385,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new RenameUploadMock([ diff --git a/test/File/UpperCaseTest.php b/test/File/UpperCaseTest.php index bd31eea2..42f86d0f 100644 --- a/test/File/UpperCaseTest.php +++ b/test/File/UpperCaseTest.php @@ -7,6 +7,7 @@ use Laminas\Filter\Exception; use Laminas\Filter\Exception\ExtensionNotLoadedException; use Laminas\Filter\File\UpperCase as FileUpperCase; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -23,23 +24,27 @@ class UpperCaseTest extends TestCase { - /** - * Testfile - * - * @var string - */ - protected $testFile; + private string $testFile; + + private static function testFilePath(): string + { + return sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid('laminas-filter')); + } + + private static function createTestFile(string $filePath): void + { + $filesPath = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; + $origFile = $filesPath . 'testfile2.txt'; + copy($origFile, $filePath); + } /** * Sets the path to test files */ public function setUp(): void { - $filesPath = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; - $origFile = $filesPath . 'testfile2.txt'; - $this->testFile = sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid('laminasilter')); - - copy($origFile, $this->testFile); + $this->testFile = self::testFilePath(); + self::createTestFile($this->testFile); } /** @@ -101,23 +106,21 @@ public function testCheckSettingOfEncodingWithMethod(): void } } - public function returnUnfilteredDataProvider() + public static function returnUnfilteredDataProvider(): array { return [ [null], [new stdClass()], [ [ - $this->testFile, + self::testFilePath(), 'something invalid', ], ], ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered($input): void { $filter = new FileUpperCase(); diff --git a/test/FilterChainTest.php b/test/FilterChainTest.php index 34be5f56..33b3df7f 100644 --- a/test/FilterChainTest.php +++ b/test/FilterChainTest.php @@ -10,6 +10,7 @@ use Laminas\Filter\StringToLower; use Laminas\Filter\StringTrim; use Laminas\Filter\StripTags; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use function count; @@ -136,9 +137,7 @@ public static function staticUcaseFilter(string $value): string return strtoupper($value); } - /** - * @group Laminas-412 - */ + #[Group('Laminas-412')] public function testCanAttachMultipleFiltersOfTheSameTypeAsDiscreteInstances(): void { $chain = new FilterChain(); diff --git a/test/FilterPluginManagerCompatibilityTest.php b/test/FilterPluginManagerCompatibilityTest.php index 18bfe37c..ec4ceef2 100644 --- a/test/FilterPluginManagerCompatibilityTest.php +++ b/test/FilterPluginManagerCompatibilityTest.php @@ -62,11 +62,12 @@ protected function getInstanceOf(): string } /** @return Generator */ - public function aliasProvider(): Generator + public static function aliasProvider(): Generator { - $pluginManager = $this->getPluginManager(); + $pluginManager = self::getPluginManager(); $r = new ReflectionProperty($pluginManager, 'aliases'); $aliases = $r->getValue($pluginManager); + self::assertIsArray($aliases); foreach ($aliases as $alias => $target) { self::assertIsString($alias); diff --git a/test/FilterPluginManagerFactoryTest.php b/test/FilterPluginManagerFactoryTest.php index e52ba299..44c6850b 100644 --- a/test/FilterPluginManagerFactoryTest.php +++ b/test/FilterPluginManagerFactoryTest.php @@ -9,6 +9,7 @@ use Laminas\Filter\FilterPluginManager; use Laminas\Filter\FilterPluginManagerFactory; use Laminas\ServiceManager\ServiceLocatorInterface; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; @@ -37,9 +38,7 @@ public function testFactoryReturnsPluginManager(): void } } - /** - * @depends testFactoryReturnsPluginManager - */ + #[Depends('testFactoryReturnsPluginManager')] public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void { $container = $this->createMock(ContainerInterface::class); @@ -54,9 +53,7 @@ public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void self::assertSame($filter, $filters->get('test')); } - /** - * @depends testFactoryReturnsPluginManager - */ + #[Depends('testFactoryReturnsPluginManager')] public function testFactoryConfiguresPluginManagerUnderServiceManagerV2() { $container = $this->createMock(ServiceLocatorInterface::class); diff --git a/test/FilterPluginManagerTest.php b/test/FilterPluginManagerTest.php index d638e7a7..0480e99e 100644 --- a/test/FilterPluginManagerTest.php +++ b/test/FilterPluginManagerTest.php @@ -11,6 +11,7 @@ use Laminas\ServiceManager\Exception\InvalidServiceException; use Laminas\ServiceManager\ServiceManager; use LaminasTest\Filter\TestAsset\NotAValidFilter; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Throwable; @@ -45,9 +46,7 @@ public function testLoadingInvalidFilterRaisesException(): void $this->filters->get('test'); } - /** - * @group 7169 - */ + #[Group('7169')] public function testFilterSuccessfullyConstructed(): void { $searchSeparator = ';'; @@ -65,9 +64,7 @@ public function testFilterSuccessfullyConstructed(): void self::assertSame($replacementSeparator, $filter->getReplacementSeparator()); } - /** - * @group 7169 - */ + #[Group('7169')] public function testFiltersConstructedAreDifferent(): void { $filterOne = $this->filters->get( diff --git a/test/HtmlEntitiesTest.php b/test/HtmlEntitiesTest.php index 5e0f44f0..9ee28382 100644 --- a/test/HtmlEntitiesTest.php +++ b/test/HtmlEntitiesTest.php @@ -7,6 +7,8 @@ use ArrayObject; use Laminas\Filter\Exception\DomainException; use Laminas\Filter\HtmlEntities as HtmlEntitiesFilter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use stdClass; @@ -67,9 +69,8 @@ public function testSetQuoteStyle(): void /** * Ensures that getCharSet() returns expected default value - * - * @group Laminas-8715 */ + #[Group('Laminas-8715')] public function testGetCharSet(): void { self::assertSame('UTF-8', $this->filter->getCharSet()); @@ -103,9 +104,8 @@ public function testSetDoubleQuote(): void /** * Ensure that fluent interfaces are supported - * - * @group Laminas-3172 */ + #[Group('Laminas-3172')] public function testFluentInterface(): void { $instance = $this->filter->setCharSet('UTF-8')->setQuoteStyle(ENT_QUOTES)->setDoubleQuote(false); @@ -116,9 +116,8 @@ public function testFluentInterface(): void * This test uses an ArrayObject in place of a Laminas\Config\Config instance; * they two are interchangeable in this scenario, as HtmlEntitiesFilter is * checking for arrays or Traversable instances. - * - * @group Laminas-8995 */ + #[Group('Laminas-8995')] public function testConfigObject(): void { $options = ['quotestyle' => 5, 'encoding' => 'ISO-8859-1']; @@ -134,9 +133,8 @@ public function testConfigObject(): void /** * Ensures that when ENT_QUOTES is set, the filtered value has both 'single' and "double" quotes encoded - * - * @group Laminas-8962 */ + #[Group('Laminas-8962')] public function testQuoteStyleQuotesEncodeBoth(): void { $input = "A 'single' and " . '"double"'; @@ -148,9 +146,8 @@ public function testQuoteStyleQuotesEncodeBoth(): void /** * Ensures that when ENT_COMPAT is set, the filtered value has only "double" quotes encoded - * - * @group Laminas-8962 */ + #[Group('Laminas-8962')] public function testQuoteStyleQuotesEncodeDouble(): void { $input = "A 'single' and " . '"double"'; @@ -162,9 +159,8 @@ public function testQuoteStyleQuotesEncodeDouble(): void /** * Ensures that when ENT_NOQUOTES is set, the filtered value leaves both "double" and 'single' quotes un-altered - * - * @group Laminas-8962 */ + #[Group('Laminas-8962')] public function testQuoteStyleQuotesEncodeNone(): void { $input = "A 'single' and " . '"double"'; @@ -174,9 +170,7 @@ public function testQuoteStyleQuotesEncodeNone(): void self::assertSame($result, $this->filter->filter($input)); } - /** - * @group Laminas-11344 - */ + #[Group('Laminas-11344')] public function testCorrectsForEncodingMismatch(): void { $string = file_get_contents(__DIR__ . '/_files/latin-1-text.txt'); @@ -184,9 +178,7 @@ public function testCorrectsForEncodingMismatch(): void self::assertGreaterThan(0, strlen($result)); } - /** - * @group Laminas-11344 - */ + #[Group('Laminas-11344')] public function testStripsUnknownCharactersWhenEncodingMismatchDetected(): void { $string = file_get_contents(__DIR__ . '/_files/latin-1-text.txt'); @@ -194,9 +186,7 @@ public function testStripsUnknownCharactersWhenEncodingMismatchDetected(): void self::assertStringContainsString('""', $result); } - /** - * @group Laminas-11344 - */ + #[Group('Laminas-11344')] public function testRaisesExceptionIfEncodingMismatchDetectedAndFinalStringIsEmpty(): void { $string = file_get_contents(__DIR__ . '/_files/latin-1-dash-only.txt'); @@ -205,7 +195,7 @@ public function testRaisesExceptionIfEncodingMismatchDetectedAndFinalStringIsEmp } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -219,9 +209,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, $this->filter->filter($input)); diff --git a/test/InflectorTest.php b/test/InflectorTest.php index 0d6de335..9b9849ca 100644 --- a/test/InflectorTest.php +++ b/test/InflectorTest.php @@ -15,6 +15,7 @@ use Laminas\Filter\Word\CamelCaseToDash; use Laminas\Filter\Word\CamelCaseToUnderscore; use Laminas\ServiceManager\ServiceManager; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use function array_values; @@ -441,9 +442,7 @@ public function testAddFilterRuleMultipleTimes(): void self::assertSame(5, count($rules)); } - /** - * @group Laminas-8997 - */ + #[Group('Laminas-8997')] public function testPassingArrayToConstructorSetsStateAndRules(): void { $options = $this->getOptions(); @@ -451,9 +450,7 @@ public function testPassingArrayToConstructorSetsStateAndRules(): void $this->_testOptions($inflector); } - /** - * @group Laminas-8997 - */ + #[Group('Laminas-8997')] public function testPassingArrayToSetConfigSetsStateAndRules(): void { $options = $this->getOptions(); @@ -462,9 +459,7 @@ public function testPassingArrayToSetConfigSetsStateAndRules(): void $this->_testOptions($inflector); } - /** - * @group Laminas-8997 - */ + #[Group('Laminas-8997')] public function testPassingConfigObjectToConstructorSetsStateAndRules(): void { $config = $this->getConfig(); @@ -472,9 +467,7 @@ public function testPassingConfigObjectToConstructorSetsStateAndRules(): void $this->_testOptions($inflector); } - /** - * @group Laminas-8997 - */ + #[Group('Laminas-8997')] public function testPassingConfigObjectToSetConfigSetsStateAndRules(): void { $config = $this->getConfig(); diff --git a/test/MonthSelectTest.php b/test/MonthSelectTest.php index a5122319..bad755bb 100644 --- a/test/MonthSelectTest.php +++ b/test/MonthSelectTest.php @@ -6,13 +6,12 @@ use Laminas\Filter\Exception\RuntimeException; use Laminas\Filter\MonthSelect as MonthSelectFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class MonthSelectTest extends TestCase { - /** - * @dataProvider provideFilter - */ + #[DataProvider('provideFilter')] public function testFilter(array $options, array $input, ?string $expected): void { $sut = new MonthSelectFilter(); @@ -21,7 +20,7 @@ public function testFilter(array $options, array $input, ?string $expected): voi } /** @return list */ - public function provideFilter(): array + public static function provideFilter(): array { return [ [[], ['year' => '2014', 'month' => '10'], '2014-10'], diff --git a/test/PregReplaceTest.php b/test/PregReplaceTest.php index 89f3abef..345685ed 100644 --- a/test/PregReplaceTest.php +++ b/test/PregReplaceTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Exception; use Laminas\Filter\PregReplace as PregReplaceFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -113,7 +114,7 @@ public function testPassingPatternWithExecModifierRaisesException(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -121,9 +122,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = $this->filter; @@ -135,7 +134,7 @@ public function testReturnUnfiltered(mixed $input): void /** * @return array[] */ - public function returnNonStringScalarValues(): array + public static function returnNonStringScalarValues(): array { return [ [1], @@ -145,9 +144,7 @@ public function returnNonStringScalarValues(): array ]; } - /** - * @dataProvider returnNonStringScalarValues - */ + #[DataProvider('returnNonStringScalarValues')] public function testShouldFilterNonStringScalarValues(float|bool|int $input): void { $filter = $this->filter; diff --git a/test/RealPathTest.php b/test/RealPathTest.php index 77df29c4..a5a2d5ea 100644 --- a/test/RealPathTest.php +++ b/test/RealPathTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\RealPath as RealPathFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -74,7 +75,7 @@ public function testNonExistentPath(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -88,9 +89,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, (new RealPathFilter())->filter($input)); diff --git a/test/StaticFilterTest.php b/test/StaticFilterTest.php index 5126d840..8b0b580f 100644 --- a/test/StaticFilterTest.php +++ b/test/StaticFilterTest.php @@ -11,6 +11,7 @@ use Laminas\Filter\StaticFilter; use Laminas\ServiceManager\Exception; use Laminas\ServiceManager\ServiceManager; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use function strtoupper; @@ -88,9 +89,8 @@ public function testStaticFactoryWithConstructorArguments(): void * exist in the namespace, get() throws an exception. * * Refactored to conform with Laminas-2724. - * - * @group Laminas-2724 */ + #[Group('Laminas-2724')] public function testStaticFactoryClassNotFound(): void { $this->expectException(Exception\ExceptionInterface::class); diff --git a/test/StringPrefixTest.php b/test/StringPrefixTest.php index d1b617b9..acbdc10e 100644 --- a/test/StringPrefixTest.php +++ b/test/StringPrefixTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Exception\InvalidArgumentException; use Laminas\Filter\StringPrefix as StringPrefixFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -45,7 +46,7 @@ public function testWithoutPrefix(): void /** * @return array */ - public function invalidPrefixesDataProvider(): array + public static function invalidPrefixesDataProvider(): array { return [ 'int' => [1], @@ -62,9 +63,7 @@ static function (): void { ]; } - /** - * @dataProvider invalidPrefixesDataProvider - */ + #[DataProvider('invalidPrefixesDataProvider')] public function testInvalidPrefixes(mixed $prefix): void { $filter = $this->filter; diff --git a/test/StringSuffixTest.php b/test/StringSuffixTest.php index 04da806d..8685d877 100644 --- a/test/StringSuffixTest.php +++ b/test/StringSuffixTest.php @@ -6,6 +6,7 @@ use Laminas\Filter\Exception\InvalidArgumentException; use Laminas\Filter\StringSuffix as StringSuffixFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -45,7 +46,7 @@ public function testWithoutSuffix(): void /** * @return array */ - public function invalidSuffixesDataProvider(): array + public static function invalidSuffixesDataProvider(): array { return [ 'int' => [1], @@ -62,9 +63,7 @@ static function (): void { ]; } - /** - * @dataProvider invalidSuffixesDataProvider - */ + #[DataProvider('invalidSuffixesDataProvider')] public function testInvalidSuffixes(mixed $suffix): void { $filter = $this->filter; diff --git a/test/StringToLowerTest.php b/test/StringToLowerTest.php index a97c3b40..26a62c4c 100644 --- a/test/StringToLowerTest.php +++ b/test/StringToLowerTest.php @@ -6,6 +6,8 @@ use Laminas\Filter\Exception; use Laminas\Filter\StringToLower as StringToLowerFilter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use stdClass; @@ -112,16 +114,14 @@ public function testCaseInsensitiveEncoding(): void } } - /** - * @group Laminas-9854 - */ + #[Group('Laminas-9854')] public function testDetectMbInternalEncoding(): void { self::assertSame(mb_internal_encoding(), $this->filter->getEncoding()); } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -135,9 +135,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, $this->filter->filter($input)); diff --git a/test/StringToUpperTest.php b/test/StringToUpperTest.php index 32e2cfa0..6bc9e01d 100644 --- a/test/StringToUpperTest.php +++ b/test/StringToUpperTest.php @@ -6,6 +6,8 @@ use Laminas\Filter\Exception; use Laminas\Filter\StringToUpper as StringToUpperFilter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use stdClass; @@ -108,16 +110,14 @@ public function testCaseInsensitiveEncoding(): void } } - /** - * @group Laminas-9854 - */ + #[Group('Laminas-9854')] public function testDetectMbInternalEncoding(): void { self::assertSame(mb_internal_encoding(), $this->filter->getEncoding()); } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -131,9 +131,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { self::assertSame($input, $this->filter->filter($input)); diff --git a/test/StringTrimTest.php b/test/StringTrimTest.php index 9c341dcc..5d6994ae 100644 --- a/test/StringTrimTest.php +++ b/test/StringTrimTest.php @@ -5,6 +5,8 @@ namespace LaminasTest\Filter; use Laminas\Filter\StringTrim; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use stdClass; @@ -69,33 +71,25 @@ public function testCharList(): void self::assertSame('a&b', $this->filter->__invoke('&&a&b&&')); } - /** - * @group Laminas-7183 - */ + #[Group('Laminas-7183')] public function testLaminas7183(): void { self::assertSame('Зенд', $this->filter->filter('Зенд')); } - /** - * @group Laminas-170 - */ + #[Group('Laminas-170')] public function testLaminas170(): void { self::assertSame('Расчет', $this->filter->filter('Расчет')); } - /** - * @group Laminas-7902 - */ + #[Group('Laminas-7902')] public function testLaminas7902(): void { self::assertSame('/', $this->filter->filter('/')); } - /** - * @group Laminas-10891 - */ + #[Group('Laminas-10891')] public function testLaminas10891(): void { self::assertSame('Зенд', $this->filter->filter(' Зенд ')); @@ -108,7 +102,7 @@ public function testLaminas10891(): void } /** @return list */ - public function getNonStringValues(): array + public static function getNonStringValues(): array { return [ [1], @@ -121,9 +115,7 @@ public function getNonStringValues(): array ]; } - /** - * @dataProvider getNonStringValues - */ + #[DataProvider('getNonStringValues')] public function testShouldNotFilterNonStringValues(mixed $value): void { self::assertSame($value, $this->filter->filter($value)); @@ -131,9 +123,8 @@ public function testShouldNotFilterNonStringValues(mixed $value): void /** * Ensures expected behavior with '0' as character list - * - * @group 6261 */ + #[Group('6261')] public function testEmptyCharList(): void { $this->filter->setCharList('0'); diff --git a/test/StripNewlinesTest.php b/test/StripNewlinesTest.php index f08d695b..31a3d28c 100644 --- a/test/StripNewlinesTest.php +++ b/test/StripNewlinesTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\StripNewlines as StripNewlinesFilter; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; @@ -45,7 +46,7 @@ public function testArrayValues(): void } /** @return list */ - public function returnUnfilteredDataProvider(): array + public static function returnUnfilteredDataProvider(): array { return [ [null], @@ -53,9 +54,7 @@ public function returnUnfilteredDataProvider(): array ]; } - /** - * @dataProvider returnUnfilteredDataProvider - */ + #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(mixed $input): void { $filter = new StripNewlinesFilter(); @@ -66,7 +65,7 @@ public function testReturnUnfiltered(mixed $input): void /** * @return array[] */ - public function returnNonStringScalarValues(): array + public static function returnNonStringScalarValues(): array { return [ [1], @@ -76,9 +75,7 @@ public function returnNonStringScalarValues(): array ]; } - /** - * @dataProvider returnNonStringScalarValues - */ + #[DataProvider('returnNonStringScalarValues')] public function testShouldFilterNonStringScalarValues(float|bool|int $input): void { $filter = new StripNewlinesFilter(); diff --git a/test/StripTagsTest.php b/test/StripTagsTest.php index 36ca790a..8b727474 100644 --- a/test/StripTagsTest.php +++ b/test/StripTagsTest.php @@ -5,6 +5,8 @@ namespace LaminasTest\Filter; use Laminas\Filter\StripTags as StripTagsFilter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use stdClass; @@ -338,10 +340,9 @@ public function testClosingAngleBracketInAllowedAttributeValue(): void /** * Ensures that an allowed attribute's value may end with an equals sign '=' - * - * @group Laminas-3293 - * @group Laminas-5983 */ + #[Group('Laminas-3293')] + #[Group('Laminas-5983')] public function testAllowedAttributeValueMayEndWithEquals(): void { $filter = $this->filter; @@ -353,9 +354,7 @@ public function testAllowedAttributeValueMayEndWithEquals(): void self::assertSame($input, $filter($input)); } - /** - * @group Laminas-5983 - */ + #[Group('Laminas-5983')] public function testDisallowedAttributesSplitOverMultipleLinesShouldBeStripped(): void { $filter = $this->filter; @@ -411,9 +410,7 @@ public function testFilterSplitCommentTags(): void self::assertSame($expected, $filter($input)); } - /** - * @group Laminas-9434 - */ + #[Group('Laminas-9434')] public function testCommentWithTagInSameLine(): void { $filter = $this->filter; @@ -422,9 +419,7 @@ public function testCommentWithTagInSameLine(): void self::assertSame($expected, $filter($input)); } - /** - * @group Laminas-9833 - */ + #[Group('Laminas-9833')] public function testMultiParamArray(): void { $filter = new StripTagsFilter(["a", "b", "hr"], [], true); @@ -434,9 +429,7 @@ public function testMultiParamArray(): void self::assertSame($expected, $filter->filter($input)); } - /** - * @group Laminas-9828 - */ + #[Group('Laminas-9828')] public function testMultiQuoteInput(): void { $filter = new StripTagsFilter( @@ -452,7 +445,7 @@ public function testMultiQuoteInput(): void } /** @return list */ - public function badCommentProvider(): array + public static function badCommentProvider(): array { return [ ['A B', 'A '], // Should be treated as just an open @@ -469,17 +462,13 @@ public function badCommentProvider(): array ]; } - /** - * @dataProvider badCommentProvider - */ + #[DataProvider('badCommentProvider')] public function testBadCommentTags(string $input, string $expected): void { self::assertSame($expected, $this->filter->filter($input)); } - /** - * @group Laminas-10256 - */ + #[Group('Laminas-10256')] public function testNotClosedHtmlCommentAtEndOfString(): void { $input = 'text