From 88bb21351785a856d58e9c8ce12deb8da64d87f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:58:20 +0000 Subject: [PATCH 1/4] Lock file maintenance Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- composer.lock | 68 ++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/composer.lock b/composer.lock index 9c1e5038..489eef1b 100644 --- a/composer.lock +++ b/composer.lock @@ -1330,16 +1330,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.42.0", + "version": "2.43.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "a5221732b2ff6df59908bbf2eb274ed3688665bc" + "reference": "8f6c2f5753dec64df924a86d18036113f3140f2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/a5221732b2ff6df59908bbf2eb274ed3688665bc", - "reference": "a5221732b2ff6df59908bbf2eb274ed3688665bc", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/8f6c2f5753dec64df924a86d18036113f3140f2b", + "reference": "8f6c2f5753dec64df924a86d18036113f3140f2b", "shasum": "" }, "require": { @@ -1410,7 +1410,7 @@ "type": "community_bridge" } ], - "time": "2023-11-06T09:13:00+00:00" + "time": "2023-11-20T01:23:15+00:00" }, { "name": "myclabs/deep-copy", @@ -1711,21 +1711,22 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.13", + "version": "v1.10.14", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d" + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/aed862e95fd286c53cc546734868dc38ff4b5b1d", - "reference": "aed862e95fd286c53cc546734868dc38ff4b5b1d", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/a86fc145edb5caedbf96527214ce3cadc9de4a32", + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32", "shasum": "" }, "require": { "pear/console_getopt": "~1.4", - "pear/pear_exception": "~1.0" + "pear/pear_exception": "~1.0", + "php": ">=5.4" }, "replace": { "rsky/pear-core-min": "self.version" @@ -1755,7 +1756,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", "source": "https://github.com/pear/pear-core-minimal" }, - "time": "2023-04-19T19:15:47+00:00" + "time": "2023-11-26T16:15:38+00:00" }, { "name": "pear/pear_exception", @@ -2138,16 +2139,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.8", + "version": "10.1.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "84838eed9ded511f61dc3e8b5944a52d9017b297" + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/84838eed9ded511f61dc3e8b5944a52d9017b297", - "reference": "84838eed9ded511f61dc3e8b5944a52d9017b297", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", "shasum": "" }, "require": { @@ -2204,7 +2205,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.8" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" }, "funding": [ { @@ -2212,7 +2213,7 @@ "type": "github" } ], - "time": "2023-11-15T13:31:15+00:00" + "time": "2023-11-23T12:23:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4593,16 +4594,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -4631,7 +4632,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -4639,20 +4640,20 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" }, { "name": "vimeo/psalm", - "version": "5.15.0", + "version": "5.16.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352" + "reference": "2897ba636551a8cb61601cc26f6ccfbba6c36591" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/5c774aca4746caf3d239d9c8cadb9f882ca29352", - "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/2897ba636551a8cb61601cc26f6ccfbba6c36591", + "reference": "2897ba636551a8cb61601cc26f6ccfbba6c36591", "shasum": "" }, "require": { @@ -4677,8 +4678,8 @@ "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.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/console": "^4.1.6 || ^5.0 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0" }, "conflict": { "nikic/php-parser": "4.17.0" @@ -4700,7 +4701,7 @@ "psalm/plugin-phpunit": "^0.18", "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.6", - "symfony/process": "^4.4 || ^5.0 || ^6.0" + "symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4713,7 +4714,7 @@ "psalm-refactor", "psalter" ], - "type": "library", + "type": "project", "extra": { "branch-alias": { "dev-master": "5.x-dev", @@ -4745,10 +4746,11 @@ "static analysis" ], "support": { + "docs": "https://psalm.dev/docs", "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.15.0" + "source": "https://github.com/vimeo/psalm" }, - "time": "2023-08-20T23:07:30+00:00" + "time": "2023-11-22T20:38:47+00:00" }, { "name": "webimpress/coding-standard", From 5d67df5f5c1a15ec4ca525703c6b6d5599a78e57 Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 4 Jan 2024 11:19:04 +0000 Subject: [PATCH 2/4] Bump dev deps, refresh lock Signed-off-by: George Steel --- composer.json | 8 +- composer.lock | 298 +++++++++++++++++++++++++++----------------------- 2 files changed, 166 insertions(+), 140 deletions(-) diff --git a/composer.json b/composer.json index 83626088..fea22727 100644 --- a/composer.json +++ b/composer.json @@ -39,14 +39,14 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-crypt": "^3.10", - "laminas/laminas-i18n": "^2.23.1", + "laminas/laminas-crypt": "^3.11", + "laminas/laminas-i18n": "^2.25.0", "laminas/laminas-uri": "^2.11", "pear/archive_tar": "^1.4.14", - "phpunit/phpunit": "^10.4.2", + "phpunit/phpunit": "^10.5.5", "psalm/plugin-phpunit": "^0.18.4", "psr/http-factory": "^1.0.2", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.18.0" }, "conflict": { "laminas/laminas-validator": "<2.10.1", diff --git a/composer.lock b/composer.lock index 489eef1b..420d9bb4 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": "c98a8c71e4369afa11fdc8cbe6de55eb", + "content-hash": "f0a26528e993851a96af4dfdd476da22", "packages": [ { "name": "laminas/laminas-servicemanager", @@ -877,16 +877,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "0.5.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" + "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/85193c0b0cb5c47894b5eaec906e946f054e7077", + "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077", "shasum": "" }, "require": { @@ -894,13 +894,13 @@ }, "require-dev": { "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", "phpstan/phpstan": "^1.9.2", "phpstan/phpstan-deprecation-rules": "^1.0.0", "phpstan/phpstan-phpunit": "^1.2.2", "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", "webmozarts/strict-phpunit": "^7.5" }, "type": "library", @@ -926,7 +926,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.0.0" }, "funding": [ { @@ -934,7 +934,7 @@ "type": "github" } ], - "time": "2022-12-24T12:35:10+00:00" + "time": "2023-09-17T21:38:23+00:00" }, { "name": "laminas/laminas-coding-standard", @@ -1120,16 +1120,16 @@ }, { "name": "laminas/laminas-i18n", - "version": "2.24.1", + "version": "2.25.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-i18n.git", - "reference": "dafb5eddfb43575befd29aeb195c55f92834fd32" + "reference": "4b6df8501bfe96648dadaf8de681cbbaea906e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/dafb5eddfb43575befd29aeb195c55f92834fd32", - "reference": "dafb5eddfb43575befd29aeb195c55f92834fd32", + "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/4b6df8501bfe96648dadaf8de681cbbaea906e04", + "reference": "4b6df8501bfe96648dadaf8de681cbbaea906e04", "shasum": "" }, "require": { @@ -1201,7 +1201,7 @@ "type": "community_bridge" } ], - "time": "2023-11-08T08:56:45+00:00" + "time": "2023-12-22T15:51:21+00:00" }, { "name": "laminas/laminas-math", @@ -1330,16 +1330,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.43.0", + "version": "2.46.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "8f6c2f5753dec64df924a86d18036113f3140f2b" + "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/8f6c2f5753dec64df924a86d18036113f3140f2b", - "reference": "8f6c2f5753dec64df924a86d18036113f3140f2b", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/98330256f8d8a1357a93f6f7f1a987036aff6329", + "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329", "shasum": "" }, "require": { @@ -1354,15 +1354,15 @@ "require-dev": { "laminas/laminas-coding-standard": "^2.5", "laminas/laminas-db": "^2.18", - "laminas/laminas-filter": "^2.32", - "laminas/laminas-i18n": "^2.23", - "laminas/laminas-session": "^2.16", - "laminas/laminas-uri": "^2.10.0", - "phpunit/phpunit": "^10.3.3", + "laminas/laminas-filter": "^2.33", + "laminas/laminas-i18n": "^2.24.1", + "laminas/laminas-session": "^2.17", + "laminas/laminas-uri": "^2.11.0", + "phpunit/phpunit": "^10.5.2", "psalm/plugin-phpunit": "^0.18.4", - "psr/http-client": "^1.0.2", + "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", - "vimeo/psalm": "^5.15" + "vimeo/psalm": "^5.17" }, "suggest": { "laminas/laminas-db": "Laminas\\Db component, required by the (No)RecordExists validator", @@ -1410,7 +1410,7 @@ "type": "community_bridge" } ], - "time": "2023-11-20T01:23:15+00:00" + "time": "2024-01-03T12:43:04+00:00" }, { "name": "myclabs/deep-copy", @@ -1524,16 +1524,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", "shasum": "" }, "require": { @@ -1574,9 +1574,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2023-12-10T21:03:43+00:00" }, { "name": "pear/archive_tar", @@ -2139,23 +2139,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.9", + "version": "10.1.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-text-template": "^3.0", @@ -2205,7 +2205,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" }, "funding": [ { @@ -2213,7 +2213,7 @@ "type": "github" } ], - "time": "2023-11-23T12:23:20+00:00" + "time": "2023-12-21T15:38:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2460,16 +2460,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.4.2", + "version": "10.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" + "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", "shasum": "" }, "require": { @@ -2509,7 +2509,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.4-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2541,7 +2541,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.5" }, "funding": [ { @@ -2557,7 +2557,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T07:21:45+00:00" + "time": "2023-12-27T15:13:52+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3023,20 +3023,20 @@ }, { "name": "sebastian/complexity", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68cfb347a44871f01e33ab0ef8215966432f6957", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -3045,7 +3045,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -3069,7 +3069,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -3077,20 +3077,20 @@ "type": "github" } ], - "time": "2023-09-28T11:50:59+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.3", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", "shasum": "" }, "require": { @@ -3103,7 +3103,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3136,7 +3136,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" }, "funding": [ { @@ -3144,7 +3144,7 @@ "type": "github" } ], - "time": "2023-05-01T07:48:21+00:00" + "time": "2023-12-22T10:55:06+00:00" }, { "name": "sebastian/environment", @@ -3352,20 +3352,20 @@ }, { "name": "sebastian/lines-of-code", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -3398,7 +3398,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -3406,7 +3406,7 @@ "type": "github" } ], - "time": "2023-08-31T09:25:50+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -3818,16 +3818,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.8.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", "shasum": "" }, "require": { @@ -3837,7 +3837,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/phpcs", @@ -3856,35 +3856,58 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "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" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T12:32:31+00:00" }, { "name": "symfony/console", - "version": "v6.3.8", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92" + "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0d14a9f6d04d4ac38a8cea1171f4554e325dae92", - "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92", + "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", + "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", "shasum": "" }, "require": { @@ -3892,7 +3915,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -3906,12 +3929,16 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3945,7 +3972,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.8" + "source": "https://github.com/symfony/console/tree/v6.4.2" }, "funding": [ { @@ -3961,7 +3988,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T08:09:35+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4032,16 +4059,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.3.1", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" + "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", + "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", "shasum": "" }, "require": { @@ -4075,7 +4102,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.1" + "source": "https://github.com/symfony/filesystem/tree/v6.4.0" }, "funding": [ { @@ -4091,7 +4118,7 @@ "type": "tidelift" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2023-07-26T17:27:13+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4425,33 +4452,29 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4461,7 +4484,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4488,7 +4514,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" }, "funding": [ { @@ -4504,20 +4530,20 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2023-12-26T14:02:43+00:00" }, { "name": "symfony/string", - "version": "v6.3.8", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "13880a87790c76ef994c91e87efb96134522577a" + "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a", - "reference": "13880a87790c76ef994c91e87efb96134522577a", + "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", + "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", "shasum": "" }, "require": { @@ -4531,11 +4557,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4574,7 +4600,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.8" + "source": "https://github.com/symfony/string/tree/v6.4.2" }, "funding": [ { @@ -4590,7 +4616,7 @@ "type": "tidelift" } ], - "time": "2023-11-09T08:28:21+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "theseer/tokenizer", @@ -4644,16 +4670,16 @@ }, { "name": "vimeo/psalm", - "version": "5.16.0", + "version": "5.18.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "2897ba636551a8cb61601cc26f6ccfbba6c36591" + "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/2897ba636551a8cb61601cc26f6ccfbba6c36591", - "reference": "2897ba636551a8cb61601cc26f6ccfbba6c36591", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/b113f3ed0259fd6e212d87c3df80eec95a6abf19", + "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19", "shasum": "" }, "require": { @@ -4672,7 +4698,7 @@ "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.1", "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", + "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.16", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", @@ -4750,20 +4776,20 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2023-11-22T20:38:47+00:00" + "time": "2023-12-16T09:37:35+00:00" }, { "name": "webimpress/coding-standard", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/webimpress/coding-standard.git", - "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899" + "reference": "710f71ac95d36d931e76b47132b599c39abfab11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/b26557e2386711ecb74f22718f4b4bde5ddbc899", - "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899", + "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/710f71ac95d36d931e76b47132b599c39abfab11", + "reference": "710f71ac95d36d931e76b47132b599c39abfab11", "shasum": "" }, "require": { @@ -4771,7 +4797,7 @@ "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "phpunit/phpunit": "^9.6.4" + "phpunit/phpunit": "^9.6.15" }, "type": "phpcodesniffer-standard", "extra": { @@ -4797,7 +4823,7 @@ ], "support": { "issues": "https://github.com/webimpress/coding-standard/issues", - "source": "https://github.com/webimpress/coding-standard/tree/1.3.1" + "source": "https://github.com/webimpress/coding-standard/tree/1.3.2" }, "funding": [ { @@ -4805,7 +4831,7 @@ "type": "github" } ], - "time": "2023-03-09T15:05:18+00:00" + "time": "2023-12-18T07:25:41+00:00" }, { "name": "webmozart/assert", From 5a7d7e6bff66c8937d9fdf9a8b8b192f5de986ec Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 4 Jan 2024 11:26:52 +0000 Subject: [PATCH 3/4] Minor type inference improvements Signed-off-by: George Steel --- psalm-baseline.xml | 137 ++++++++++----------------------- src/Compress.php | 52 ++++++++----- src/Decompress.php | 8 +- src/File/Rename.php | 6 +- src/File/UpperCase.php | 7 +- src/PregReplace.php | 4 +- src/StringPrefix.php | 5 +- src/StringSuffix.php | 5 +- src/StripTags.php | 18 ++--- test/CompressTest.php | 34 ++++++-- test/DateTimeFormatterTest.php | 1 + test/DecompressTest.php | 20 ++++- test/StripTagsTest.php | 1 + 13 files changed, 145 insertions(+), 153 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e4d003b6..ad362ba9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + filterable @@ -129,36 +129,21 @@ - ! is_array($options) + is_string($adapter) mixed - - $adapter - $adapterOptions - - - $adapter - $adapter - $key - adapter]]> - + + $options + - $adapter - $key $value - - array - new $adapter($options) - - adapterOptions]]> - $options @@ -436,17 +421,6 @@ - - ! is_string($value) - - - $value - - - $value - $value - $value - $value @@ -469,11 +443,13 @@ adapter->decrypt($value)]]> - $value $value + + return $value; + @@ -524,16 +500,21 @@ adapter->encrypt($value)]]> adapter->toString()]]> - $value $value + + return $value; + __call getAdapter getAdapterInstance + + + @@ -560,6 +541,10 @@ encryption]]> $value + + compression]]> + compression]]> + @@ -577,6 +562,7 @@ encryption['vector']]]> + $decrypted $options $value @@ -584,11 +570,14 @@ array string string + string encryption]]> + $decrypted + $decrypted encryption]]> encryption['key']]]> encryption['vector']]]> @@ -621,6 +610,10 @@ + + compression]]> + compression]]> + Openssl @@ -652,6 +645,7 @@ $count + $decrypted $envKey $i $i @@ -663,6 +657,9 @@ $option $option + + string + $i @@ -670,6 +667,10 @@ keys]]> + + $decrypted + $decrypted + __construct getCompression @@ -722,11 +723,13 @@ filename]]> filename]]> $uploadData - $value $value + + return $value; + $filename @@ -777,11 +780,13 @@ filename]]> filename]]> $uploadData - $value $value + + return $value; + $filename @@ -809,7 +814,6 @@ - is_array($options) is_array($options) @@ -834,7 +838,6 @@ $value - $value $options @@ -855,18 +858,10 @@ string - string|array - - $uploadData - $uploadData - $value - - $value - @@ -987,31 +982,9 @@ - - - - - $value - $value - $value - $value - $value - - string|array - - - $uploadData - $value - $value - $value - - - $value - $value - $uploadData @@ -1312,37 +1285,23 @@ - - is_scalar($value) - - tagsAllowed[$tagName]]]> - - tagsAllowed[$tagName][$attributeName]]]> - - $attribute $attribute $element - - $value - $temp - - (string) $value - (string) $value - is_array($options) + is_string($attribute) @@ -1404,9 +1363,6 @@ is_string($separator) - - $separator - $separator @@ -1613,9 +1569,6 @@ getArchive getArchive - - $adapter - @@ -1639,16 +1592,9 @@ - - $compressed - $input - $compressed - - null - returnUnfilteredDataProvider @@ -1885,7 +1831,6 @@ $filtered - $input $filtered diff --git a/src/Compress.php b/src/Compress.php index 783b0245..501870e5 100644 --- a/src/Compress.php +++ b/src/Compress.php @@ -20,46 +20,55 @@ /** * Compresses a given string * + * @psalm-type AdapterType = 'Bz2'|'Gz'|'Lzf'|'Rar'|'Snappy'|'Tar'|'Zip' + * @psalm-type AdapterTypeOrInstance = Compress\CompressionAlgorithmInterface|AdapterType * @psalm-type Options = array{ - * adapter?: Compress\CompressionAlgorithmInterface|'Bz2'|'Gz'|'Lzf'|'Rar'|'Snappy'|'Tar'|'Zip', - * adapter_options?: array, - * ... - * } + * adapter?: AdapterTypeOrInstance, + * options?: array, + * }&array * @extends AbstractFilter */ class Compress extends AbstractFilter { /** * Compression adapter + * + * @var AdapterTypeOrInstance */ protected $adapter = 'Gz'; /** * Compression adapter constructor options + * + * @var array */ protected $adapterOptions = []; /** - * @param string|array|Traversable $options (Optional) Options to set + * @param Options|Traversable|null|AdapterTypeOrInstance $options */ public function __construct($options = null) { if ($options instanceof Traversable) { + /** @psalm-var Options $options */ $options = ArrayUtils::iteratorToArray($options); } - if (is_string($options)) { - $this->setAdapter($options); - } elseif ($options instanceof Compress\CompressionAlgorithmInterface) { + + if (is_string($options) || $options instanceof Compress\CompressionAlgorithmInterface) { $this->setAdapter($options); - } elseif (is_array($options)) { + + return; + } + + if (is_array($options)) { $this->setOptions($options); } } /** - * Set filter setate + * Set filter state * - * @param array $options + * @param Options|Traversable $options * @throws Exception\InvalidArgumentException If options is not an array or Traversable. * @return self */ @@ -111,13 +120,17 @@ public function getAdapter() } } - $this->adapter = new $adapter($options); - if (! $this->adapter instanceof Compress\CompressionAlgorithmInterface) { - throw new Exception\InvalidArgumentException( - "Compression adapter '" . $adapter - . "' does not implement Laminas\\Filter\\Compress\\CompressionAlgorithmInterface" - ); + $instance = new $adapter($options); + if (! $instance instanceof Compress\CompressionAlgorithmInterface) { + throw new Exception\InvalidArgumentException(sprintf( + "Compression adapter '%s' does not implement %s", + $adapter, + CompressionAlgorithmInterface::class, + )); } + + $this->adapter = $instance; + return $this->adapter; } @@ -134,7 +147,7 @@ public function getAdapterName() /** * Sets compression adapter * - * @param string|CompressionAlgorithmInterface $adapter Adapter to use + * @param AdapterTypeOrInstance $adapter Adapter to use * @return self * @throws Exception\InvalidArgumentException */ @@ -158,7 +171,7 @@ public function setAdapter($adapter) /** * Retrieve adapter options * - * @return array + * @return array */ public function getAdapterOptions() { @@ -168,6 +181,7 @@ public function getAdapterOptions() /** * Set adapter options * + * @param array $options * @return self */ public function setAdapterOptions(array $options) diff --git a/src/Decompress.php b/src/Decompress.php index 51896e85..ab3f5511 100644 --- a/src/Decompress.php +++ b/src/Decompress.php @@ -18,8 +18,8 @@ class Decompress extends Compress * * Decompresses the content $value with the defined settings * - * @param string $value Content to decompress - * @return string The decompressed content + * @param mixed $value Content to decompress + * @return mixed|string The decompressed content */ public function __invoke($value) { @@ -31,8 +31,8 @@ public function __invoke($value) * * Decompresses the content $value with the defined settings * - * @param string $value Content to decompress - * @return string The decompressed content + * @param mixed $value Content to decompress + * @return mixed|string The decompressed content */ public function filter($value) { diff --git a/src/File/Rename.php b/src/File/Rename.php index 66810dc6..5aaea12f 100644 --- a/src/File/Rename.php +++ b/src/File/Rename.php @@ -177,9 +177,9 @@ public function getNewName($value, $source = false) * Renames the file $value to the new name set before * Returns the file $value, removing all but digit characters * - * @param string|array $value Full path of file to change or $_FILES data array + * @param mixed $value Full path of file to change or $_FILES data array * @throws Exception\RuntimeException - * @return string|array The new filename which has been set + * @return mixed|string|array The new filename which has been set */ public function filter($value) { @@ -199,7 +199,7 @@ public function filter($value) $value = $value['tmp_name']; } - $file = $this->getNewName($value, true); + $file = $this->getNewName((string) $value, true); if (is_string($file)) { if ($isFileUpload) { return $uploadData; diff --git a/src/File/UpperCase.php b/src/File/UpperCase.php index cddd91da..76372026 100644 --- a/src/File/UpperCase.php +++ b/src/File/UpperCase.php @@ -12,6 +12,7 @@ use function file_put_contents; use function is_array; use function is_scalar; +use function is_string; use function is_writable; /** @final */ @@ -22,8 +23,8 @@ class UpperCase extends StringToUpper * * Does a lowercase on the content of the given file * - * @param string|array $value Full path of file to change or $_FILES data array - * @return string|array The given $value + * @param mixed $value Full path of file to change or $_FILES data array + * @return mixed|string|array The given $value * @throws Exception\RuntimeException * @throws Exception\InvalidArgumentException */ @@ -45,7 +46,7 @@ public function filter($value) $value = $value['tmp_name']; } - if (! file_exists($value)) { + if (! is_string($value) || ! file_exists($value)) { throw new Exception\InvalidArgumentException("File '$value' not found"); } diff --git a/src/PregReplace.php b/src/PregReplace.php index c7c300f1..bb793778 100644 --- a/src/PregReplace.php +++ b/src/PregReplace.php @@ -9,9 +9,7 @@ use function func_get_args; use function get_debug_type; -use function gettype; use function is_array; -use function is_object; use function is_string; use function iterator_to_array; use function preg_match; @@ -77,7 +75,7 @@ public function setPattern($pattern) throw new Exception\InvalidArgumentException(sprintf( '%s expects pattern to be array or string; received "%s"', __METHOD__, - is_object($pattern) ? $pattern::class : gettype($pattern) + get_debug_type($pattern), )); } diff --git a/src/StringPrefix.php b/src/StringPrefix.php index af3d870e..0eaf8b91 100644 --- a/src/StringPrefix.php +++ b/src/StringPrefix.php @@ -4,8 +4,7 @@ namespace Laminas\Filter; -use function gettype; -use function is_object; +use function get_debug_type; use function is_scalar; use function is_string; use function sprintf; @@ -47,7 +46,7 @@ public function setPrefix($prefix) throw new Exception\InvalidArgumentException(sprintf( '%s expects "prefix" to be string; received "%s"', __METHOD__, - is_object($prefix) ? $prefix::class : gettype($prefix) + get_debug_type($prefix), )); } diff --git a/src/StringSuffix.php b/src/StringSuffix.php index 1b5d7f50..d9ffaad5 100644 --- a/src/StringSuffix.php +++ b/src/StringSuffix.php @@ -4,8 +4,7 @@ namespace Laminas\Filter; -use function gettype; -use function is_object; +use function get_debug_type; use function is_scalar; use function is_string; use function sprintf; @@ -47,7 +46,7 @@ public function setSuffix($suffix) throw new Exception\InvalidArgumentException(sprintf( '%s expects "suffix" to be string; received "%s"', __METHOD__, - is_object($suffix) ? $suffix::class : gettype($suffix) + get_debug_type($suffix), )); } diff --git a/src/StripTags.php b/src/StripTags.php index 0436f8e8..7222014b 100644 --- a/src/StripTags.php +++ b/src/StripTags.php @@ -46,7 +46,7 @@ class StripTags extends AbstractFilter * Tags are stored in the array keys, and the array values are themselves * arrays of the attributes allowed for the corresponding tag. * - * @var array + * @var array> */ protected $tagsAllowed = []; @@ -55,7 +55,7 @@ class StripTags extends AbstractFilter * * Attributes stored here are allowed for all of the allowed tags. * - * @var array + * @var array */ protected $attributesAllowed = []; @@ -102,7 +102,7 @@ public function __construct($options = null) /** * Returns the tagsAllowed option * - * @return array + * @return array> */ public function getTagsAllowed() { @@ -154,7 +154,7 @@ public function setTagsAllowed($tagsAllowed) /** * Returns the attributesAllowed option * - * @return array + * @return array */ public function getAttributesAllowed() { @@ -164,7 +164,7 @@ public function getAttributesAllowed() /** * Sets the attributesAllowed option * - * @param array|string $attributesAllowed + * @param list|string $attributesAllowed * @return self Provides a fluent interface */ public function setAttributesAllowed($attributesAllowed) @@ -190,8 +190,7 @@ public function setAttributesAllowed($attributesAllowed) * * If the value provided is non-scalar, the value will remain unfiltered * - * @todo improve docblock descriptions - * @param string $value + * @param mixed $value * @return string|mixed */ public function filter($value) @@ -220,7 +219,7 @@ public function filter($value) $dataFiltered = ''; // Parse the input data iteratively as regular pre-tag text followed by a // tag; either may be empty strings - preg_match_all('/([^<]*)(]*>?)/', (string) $value, $matches); + preg_match_all('/([^<]*)(]*>?)/', $value, $matches); // Iterate over each set of matches foreach ($matches[1] as $index => $preTag) { @@ -249,8 +248,7 @@ public function filter($value) * @param string $tag * @return string */ - // @codingStandardsIgnoreStart - protected function _filterTag($tag) + protected function _filterTag($tag) // phpcs:ignore { // @codingStandardsIgnoreEnd // Parse the tag into: diff --git a/test/CompressTest.php b/test/CompressTest.php index e7a07020..b8dab312 100644 --- a/test/CompressTest.php +++ b/test/CompressTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Filter; use Laminas\Filter\Boolean; +use Laminas\Filter\Compress; use Laminas\Filter\Compress as CompressFilter; use Laminas\Filter\Compress\CompressionAlgorithmInterface; use Laminas\Filter\Exception; @@ -22,6 +23,7 @@ use function uniqid; use function unlink; +/** @psalm-import-type AdapterType from Compress */ class CompressTest extends TestCase { private string $tmpDir; @@ -48,19 +50,21 @@ public function tearDown(): void } } - /** @return iterable */ + /** @return iterable */ public static function returnFilterType(): iterable { if (extension_loaded('bz2')) { - yield ['bz2']; + yield ['Bz2']; } if (extension_loaded('zlib')) { - yield ['gz']; + yield ['Gz']; } } /** * Basic usage + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testBasicUsage(string $filterType): void @@ -77,6 +81,8 @@ public function testBasicUsage(string $filterType): void /** * Setting Options + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testGetSetAdapterOptionsInConstructor(string $filterType): void @@ -99,6 +105,8 @@ public function testGetSetAdapterOptionsInConstructor(string $filterType): void /** * Setting Options through constructor + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testGetSetAdapterOptions(string $filterType): void @@ -124,7 +132,7 @@ public function testGetSetBlocksize(): void self::markTestSkipped('Extension bz2 is required for this test'); } - $filter = new CompressFilter('bz2'); + $filter = new CompressFilter('Bz2'); self::assertSame(4, $filter->getBlocksize()); $filter->setBlocksize(6); self::assertSame(6, $filter->getOptions('blocksize')); @@ -136,6 +144,8 @@ public function testGetSetBlocksize(): void /** * Setting Archive + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testGetSetArchive(string $filterType): void @@ -149,6 +159,8 @@ public function testGetSetArchive(string $filterType): void /** * Setting Archive + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testCompressToFile(string $filterType): void @@ -172,6 +184,8 @@ public function testCompressToFile(string $filterType): void /** * testing toString + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testToString(string $filterType): void @@ -182,6 +196,8 @@ public function testToString(string $filterType): void /** * testing getAdapter + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testGetAdapter(string $filterType): void @@ -204,15 +220,18 @@ public function testSetAdapter(): void $filter = new CompressFilter(); self::assertSame('Gz', $filter->getAdapterName()); + /** @psalm-suppress InvalidArgument */ $filter->setAdapter(Boolean::class); $this->expectException(Exception\InvalidArgumentException::class); $this->expectExceptionMessage('does not implement'); - $adapter = $filter->getAdapter(); + $filter->getAdapter(); } /** - * Decompress archiv + * Decompress archive + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testDecompressArchive(string $filterType): void @@ -257,6 +276,9 @@ public static function returnUnfilteredDataProvider(): iterable } } + /** + * @param AdapterType $filterType + */ #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(string $filterType, mixed $input): void { diff --git a/test/DateTimeFormatterTest.php b/test/DateTimeFormatterTest.php index b77a2812..6c072aa7 100644 --- a/test/DateTimeFormatterTest.php +++ b/test/DateTimeFormatterTest.php @@ -17,6 +17,7 @@ class DateTimeFormatterTest extends TestCase { + /** @var non-empty-string */ private string $defaultTimezone; public function setUp(): void diff --git a/test/DecompressTest.php b/test/DecompressTest.php index b68c58c8..d03195b5 100644 --- a/test/DecompressTest.php +++ b/test/DecompressTest.php @@ -4,6 +4,7 @@ namespace LaminasTest\Filter; +use Laminas\Filter\Compress; use Laminas\Filter\Decompress as DecompressFilter; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; @@ -19,6 +20,7 @@ use function uniqid; use function unlink; +/** @psalm-import-type AdapterType from Compress */ class DecompressTest extends TestCase { private string $tmpDir; @@ -45,19 +47,21 @@ public function tearDown(): void } } - /** @return iterable */ + /** @return iterable */ public static function returnFilterType(): iterable { if (extension_loaded('bz2')) { - yield ['bz2']; + yield ['Bz2']; } if (extension_loaded('zlib')) { - yield ['gz']; + yield ['Gz']; } } /** * Basic usage + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testBasicUsage(string $filterType): void @@ -74,6 +78,8 @@ public function testBasicUsage(string $filterType): void /** * Setting Archive + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testCompressToFile(string $filterType): void @@ -97,6 +103,8 @@ public function testCompressToFile(string $filterType): void /** * Basic usage + * + * @param AdapterType $filterType */ #[DataProvider('returnFilterType')] public function testDecompressArchive(string $filterType): void @@ -113,6 +121,9 @@ public function testDecompressArchive(string $filterType): void self::assertSame('compress me', $content2); } + /** + * @param AdapterType $filterType + */ #[DataProvider('returnFilterType')] public function testFilterMethodProxiesToDecompress(string $filterType): void { @@ -143,6 +154,9 @@ public static function returnUnfilteredDataProvider(): iterable } } + /** + * @param AdapterType $filterType + */ #[DataProvider('returnUnfilteredDataProvider')] public function testReturnUnfiltered(string $filterType, mixed $input): void { diff --git a/test/StripTagsTest.php b/test/StripTagsTest.php index 8b727474..08d7532c 100644 --- a/test/StripTagsTest.php +++ b/test/StripTagsTest.php @@ -85,6 +85,7 @@ public function testSetAttributesAllowedArray(): void 'ok' => 'String', null, ]; + /** @psalm-suppress ArgumentTypeCoercion */ $this->filter->setAttributesAllowed($attributesAllowed); $attributesAllowedExpected = [ 'class' => null, From 2087a5ef28a3c1ca94888411dfedc4a95dd6a04d Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 4 Jan 2024 11:45:14 +0000 Subject: [PATCH 4/4] Use existing imported alias Signed-off-by: George Steel --- test/CompressTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/CompressTest.php b/test/CompressTest.php index b8dab312..2cff2fcf 100644 --- a/test/CompressTest.php +++ b/test/CompressTest.php @@ -5,7 +5,6 @@ namespace LaminasTest\Filter; use Laminas\Filter\Boolean; -use Laminas\Filter\Compress; use Laminas\Filter\Compress as CompressFilter; use Laminas\Filter\Compress\CompressionAlgorithmInterface; use Laminas\Filter\Exception; @@ -23,7 +22,7 @@ use function uniqid; use function unlink; -/** @psalm-import-type AdapterType from Compress */ +/** @psalm-import-type AdapterType from CompressFilter */ class CompressTest extends TestCase { private string $tmpDir;