From 633a37b2a7b7e01000fd2b1e5c6c198e29b5d26f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:47:52 +0000 Subject: [PATCH 1/3] Lock file maintenance Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- composer.lock | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/composer.lock b/composer.lock index 0f70098..c87f390 100644 --- a/composer.lock +++ b/composer.lock @@ -1686,16 +1686,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": { @@ -1752,7 +1752,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": [ { @@ -1760,7 +1760,7 @@ "type": "github" } ], - "time": "2023-11-15T13:31:15+00:00" + "time": "2023-11-23T12:23:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4440,16 +4440,16 @@ }, { "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": { @@ -4474,8 +4474,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" @@ -4497,7 +4497,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", @@ -4510,7 +4510,7 @@ "psalm-refactor", "psalter" ], - "type": "library", + "type": "project", "extra": { "branch-alias": { "dev-master": "5.x-dev", @@ -4542,10 +4542,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 76c6d05b1885512e02fca222d1fcaec59608a865 Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 3 Jan 2024 15:22:35 +0000 Subject: [PATCH 2/3] Bump dev deps, refresh lock Signed-off-by: George Steel --- composer.json | 8 +- composer.lock | 345 +++++++++++++++++++++++++++----------------------- 2 files changed, 194 insertions(+), 159 deletions(-) diff --git a/composer.json b/composer.json index 2ae63e1..fa8a99b 100644 --- a/composer.json +++ b/composer.json @@ -34,12 +34,12 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-stdlib": "^3.17", - "phpbench/phpbench": "^1.2.10", - "phpunit/phpunit": "^10.4.1", + "laminas/laminas-stdlib": "^3.18", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^10.5.5", "psalm/plugin-phpunit": "^0.18.4", "psr/container": "^1.1.2 || ^2.0.2", - "vimeo/psalm": "^5.11" + "vimeo/psalm": "^5.18" }, "suggest": { "psr/container": "^1.1.2 || ^2.0.2, to use the lazy listeners feature", diff --git a/composer.lock b/composer.lock index c87f390..613bc2b 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": "a7c10ca92b9a608b3213479cf6fc92a9", + "content-hash": "c3fbf35843099a2c6ce1c58b24b0d620", "packages": [], "packages-dev": [ { @@ -832,16 +832,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": { @@ -849,13 +849,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", @@ -881,7 +881,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": [ { @@ -889,7 +889,7 @@ "type": "github" } ], - "time": "2022-12-24T12:35:10+00:00" + "time": "2023-09-17T21:38:23+00:00" }, { "name": "laminas/laminas-coding-standard", @@ -1118,16 +1118,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": { @@ -1168,9 +1168,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": "phar-io/manifest", @@ -1387,49 +1387,50 @@ }, { "name": "phpbench/phpbench", - "version": "1.2.14", + "version": "1.2.15", "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "edbd1b7ecf704eb01f7a2bcd1b8aa8c189f9fa4e" + "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/edbd1b7ecf704eb01f7a2bcd1b8aa8c189f9fa4e", - "reference": "edbd1b7ecf704eb01f7a2bcd1b8aa8c189f9fa4e", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/f7000319695cfad04a57fc64bf7ef7abdf4c437c", + "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c", "shasum": "" }, "require": { - "doctrine/annotations": "^1.13 || ^2.0", + "doctrine/annotations": "^2.0", "ext-dom": "*", "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", + "php": "^8.1", "phpbench/container": "^2.1", "phpbench/dom": "~0.3.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "seld/jsonlint": "^1.1", - "symfony/console": "^4.2 || ^5.0 || ^6.0", - "symfony/filesystem": "^4.2 || ^5.0 || ^6.0", - "symfony/finder": "^4.2 || ^5.0 || ^6.0", - "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0", - "symfony/process": "^4.2 || ^5.0 || ^6.0", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/filesystem": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/finder": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/process": "^4.2 || ^5.0 || ^6.0 || ^7.0", "webmozart/glob": "^4.6" }, "require-dev": { "dantleech/invoke": "^2.0", "friendsofphp/php-cs-fixer": "^3.0", "jangregor/phpstan-prophecy": "^1.0", - "phpspec/prophecy": "^1.12", + "phpspec/prophecy": "dev-master", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.0", - "symfony/error-handler": "^5.2 || ^6.0", - "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0" + "phpunit/phpunit": "^10.0", + "rector/rector": "^0.18.10", + "symfony/error-handler": "^5.2 || ^6.0 || ^7.0", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-xdebug": "For Xdebug profiling extension." @@ -1463,9 +1464,16 @@ } ], "description": "PHP Benchmarking Framework", + "keywords": [ + "benchmarking", + "optimization", + "performance", + "profiling", + "testing" + ], "support": { "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.2.14" + "source": "https://github.com/phpbench/phpbench/tree/1.2.15" }, "funding": [ { @@ -1473,7 +1481,7 @@ "type": "github" } ], - "time": "2023-07-09T09:16:08+00:00" + "time": "2023-11-29T12:21:11+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1686,23 +1694,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", @@ -1752,7 +1760,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": [ { @@ -1760,7 +1768,7 @@ "type": "github" } ], - "time": "2023-11-23T12:23:20+00:00" + "time": "2023-12-21T15:38:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2007,16 +2015,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": { @@ -2056,7 +2064,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.4-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2088,7 +2096,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": [ { @@ -2104,7 +2112,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T07:21:45+00:00" + "time": "2023-12-27T15:13:52+00:00" }, { "name": "psalm/plugin-phpunit", @@ -2564,20 +2572,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": { @@ -2586,7 +2594,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -2610,7 +2618,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": [ { @@ -2618,20 +2626,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": { @@ -2644,7 +2652,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2677,7 +2685,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": [ { @@ -2685,7 +2693,7 @@ "type": "github" } ], - "time": "2023-05-01T07:48:21+00:00" + "time": "2023-12-22T10:55:06+00:00" }, { "name": "sebastian/environment", @@ -2893,20 +2901,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": { @@ -2939,7 +2947,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": [ { @@ -2947,7 +2955,7 @@ "type": "github" } ], - "time": "2023-08-31T09:25:50+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -3235,16 +3243,16 @@ }, { "name": "seld/jsonlint", - "version": "1.10.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" + "reference": "76d449a358ece77d6f1d6331c68453e657172202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/76d449a358ece77d6f1d6331c68453e657172202", + "reference": "76d449a358ece77d6f1d6331c68453e657172202", "shasum": "" }, "require": { @@ -3271,7 +3279,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -3283,7 +3291,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.1" }, "funding": [ { @@ -3295,7 +3303,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T13:16:46+00:00" + "time": "2023-12-18T13:03:25+00:00" }, { "name": "slevomat/coding-standard", @@ -3423,16 +3431,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": { @@ -3442,7 +3450,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", @@ -3461,35 +3469,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": { @@ -3497,7 +3528,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", @@ -3511,12 +3542,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": { @@ -3550,7 +3585,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.8" + "source": "https://github.com/symfony/console/tree/v6.4.2" }, "funding": [ { @@ -3566,7 +3601,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T08:09:35+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3637,16 +3672,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": { @@ -3680,7 +3715,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": [ { @@ -3696,27 +3731,27 @@ "type": "tidelift" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2023-07-26T17:27:13+00:00" }, { "name": "symfony/finder", - "version": "v6.3.5", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", + "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { @@ -3744,7 +3779,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.5" + "source": "https://github.com/symfony/finder/tree/v6.4.0" }, "funding": [ { @@ -3760,20 +3795,20 @@ "type": "tidelift" } ], - "time": "2023-09-26T12:56:25+00:00" + "time": "2023-10-31T17:30:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.3.0", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" + "reference": "22301f0e7fdeaacc14318928612dee79be99860e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/22301f0e7fdeaacc14318928612dee79be99860e", + "reference": "22301f0e7fdeaacc14318928612dee79be99860e", "shasum": "" }, "require": { @@ -3811,7 +3846,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.0" }, "funding": [ { @@ -3827,7 +3862,7 @@ "type": "tidelift" } ], - "time": "2023-05-12T14:21:09+00:00" + "time": "2023-08-08T10:16:24+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4161,16 +4196,16 @@ }, { "name": "symfony/process", - "version": "v6.3.4", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" + "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", + "url": "https://api.github.com/repos/symfony/process/zipball/c4b1ef0bc80533d87a2e969806172f1c2a980241", + "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241", "shasum": "" }, "require": { @@ -4202,7 +4237,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.4" + "source": "https://github.com/symfony/process/tree/v6.4.2" }, "funding": [ { @@ -4218,25 +4253,25 @@ "type": "tidelift" } ], - "time": "2023-08-07T10:39:22+00:00" + "time": "2023-12-22T16:42:54+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.4.0", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4284,7 +4319,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" }, "funding": [ { @@ -4300,20 +4335,20 @@ "type": "tidelift" } ], - "time": "2023-07-30T20:28:31+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": { @@ -4327,11 +4362,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": { @@ -4370,7 +4405,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.8" + "source": "https://github.com/symfony/string/tree/v6.4.2" }, "funding": [ { @@ -4386,7 +4421,7 @@ "type": "tidelift" } ], - "time": "2023-11-09T08:28:21+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "theseer/tokenizer", @@ -4440,16 +4475,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": { @@ -4468,7 +4503,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", @@ -4546,20 +4581,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": { @@ -4567,7 +4602,7 @@ "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "phpunit/phpunit": "^9.6.4" + "phpunit/phpunit": "^9.6.15" }, "type": "phpcodesniffer-standard", "extra": { @@ -4593,7 +4628,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": [ { @@ -4601,7 +4636,7 @@ "type": "github" } ], - "time": "2023-03-09T15:05:18+00:00" + "time": "2023-12-18T07:25:41+00:00" }, { "name": "webmozart/assert", From 9a3675b3d4c3a3c73ba30bf9d127afb2fedf57ea Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 3 Jan 2024 15:57:47 +0000 Subject: [PATCH 3/3] Cleanup unused code, fix a range of minor psalm issues Signed-off-by: George Steel --- psalm-baseline.xml | 85 +++++++++++-------- psalm.xml | 17 ++-- src/Event.php | 3 +- src/EventManager.php | 7 +- src/LazyListenerAggregate.php | 5 +- src/SharedEventManager.php | 11 ++- test/AbstractListenerAggregateTest.php | 48 ++++++++++- test/FilterChainTest.php | 2 - test/ListenerAggregateTraitTest.php | 8 +- test/SharedListenerIntegrationTest.php | 8 +- test/TestAsset/CountingListener.php | 5 +- test/TestAsset/Functor.php | 16 ---- .../MockAbstractListenerAggregate.php | 7 +- test/TestAsset/MockAggregate.php | 55 ------------ test/TestAsset/MockEventManagerAwareTrait.php | 17 +--- test/TestAsset/StaticEventsMock.php | 49 ----------- 16 files changed, 123 insertions(+), 220 deletions(-) delete mode 100644 test/TestAsset/Functor.php delete mode 100644 test/TestAsset/MockAggregate.php delete mode 100644 test/TestAsset/StaticEventsMock.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c363fc2..3e0d577 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + is_string($eventName) @@ -25,6 +25,11 @@ (int) $priority + + + EventManagerAwareInterface + + $events @@ -32,15 +37,33 @@ setEventManager - - $identifiers - - + + getEventManager + + eventIdentifier)) || (is_array($this->eventIdentifier))]]> eventIdentifier)]]> eventIdentifier)]]> - + + + eventIdentifier instanceof Traversable]]> + eventIdentifier)) + || (is_array($this->eventIdentifier))]]> + eventIdentifier)) + || (is_array($this->eventIdentifier)) + || $this->eventIdentifier instanceof Traversable]]> + eventIdentifier)) + || (is_array($this->eventIdentifier)) + || $this->eventIdentifier instanceof Traversable]]> + eventIdentifier)]]> + eventIdentifier)]]> + + + + + getEventManager + @@ -113,10 +136,19 @@ listener]]> listener]]> + + callable + $listener + + + $container + $env + + setStopped @@ -209,9 +241,6 @@ - - string - attach clearListeners @@ -438,12 +467,6 @@ LazyListener - - - getCallbacks - getCallbacks - - testAttachRaisesExceptionForInvalidEvent @@ -489,6 +512,11 @@ $callback + + + count]]> + + $e @@ -573,34 +601,23 @@ build + + build + + + + + $index + doFoo - - - string - - - listeners]]> - - - $listener - - - $listener - - doFoo - - - attach - - diff --git a/psalm.xml b/psalm.xml index 2e18e49..64ba454 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,9 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" + findUnusedCode="true" + findUnusedBaselineEntry="true" + findUnusedPsalmSuppress="true" > @@ -16,19 +19,11 @@ - + - + - - - - - - - - - + diff --git a/src/Event.php b/src/Event.php index 7df5840..e747144 100644 --- a/src/Event.php +++ b/src/Event.php @@ -93,7 +93,7 @@ public function getTarget() */ public function setParams($params) { - /** @psalm-suppress DocblockTypeContradiction Sanity check to actually enforce docblock. */ + /** @psalm-suppress DocblockTypeContradiction, RedundantCondition Sanity check to actually enforce docblock. */ if (! is_array($params) && ! is_object($params)) { throw new Exception\InvalidArgumentException( sprintf('Event parameters must be an array or object; received "%s"', gettype($params)) @@ -128,7 +128,6 @@ public function getParam($name, $default = null) } // Check in normal objects - /** @psalm-suppress MixedPropertyFetch Only object is left over from union. */ if (! isset($this->params->{$name})) { return $default; } diff --git a/src/EventManager.php b/src/EventManager.php index 33d6a2b..bf0e057 100644 --- a/src/EventManager.php +++ b/src/EventManager.php @@ -7,8 +7,7 @@ use function array_keys; use function array_merge; use function array_unique; -use function gettype; -use function is_object; +use function get_debug_type; use function is_string; use function krsort; use function sprintf; @@ -187,7 +186,7 @@ public function attach($eventName, callable $listener, $priority = 1) throw new Exception\InvalidArgumentException(sprintf( '%s expects a string for the event; received %s', __METHOD__, - is_object($eventName) ? $eventName::class : gettype($eventName) + get_debug_type($eventName), )); } @@ -213,7 +212,7 @@ public function detach(callable $listener, $eventName = null, $force = false) throw new Exception\InvalidArgumentException(sprintf( '%s expects a string for the event; received %s', __METHOD__, - is_object($eventName) ? $eventName::class : gettype($eventName) + get_debug_type($eventName), )); } diff --git a/src/LazyListenerAggregate.php b/src/LazyListenerAggregate.php index 6a5b705..105a646 100644 --- a/src/LazyListenerAggregate.php +++ b/src/LazyListenerAggregate.php @@ -4,9 +4,8 @@ use Psr\Container\ContainerInterface; -use function gettype; +use function get_debug_type; use function is_array; -use function is_object; use function sprintf; /** @@ -78,7 +77,7 @@ public function __construct(array $listeners, ContainerInterface $container, arr if (! $listener instanceof LazyEventListener) { throw new Exception\InvalidArgumentException(sprintf( 'All listeners must be LazyEventListener instances or definitions; received %s', - is_object($listener) ? $listener::class : gettype($listener) + get_debug_type($listener), )); } diff --git a/src/SharedEventManager.php b/src/SharedEventManager.php index 2b66228..24e9169 100644 --- a/src/SharedEventManager.php +++ b/src/SharedEventManager.php @@ -4,8 +4,7 @@ use function array_keys; use function array_merge; -use function gettype; -use function is_object; +use function get_debug_type; use function is_string; use function sprintf; @@ -63,14 +62,14 @@ public function attach($identifier, $event, callable $listener, $priority = 1) if (! is_string($identifier) || empty($identifier)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid identifier provided; must be a string; received "%s"', - is_object($identifier) ? $identifier::class : gettype($identifier) + get_debug_type($identifier), )); } if (! is_string($event) || empty($event)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid event provided; must be a non-empty string; received "%s"', - is_object($event) ? $event::class : gettype($event) + get_debug_type($event), )); } @@ -93,7 +92,7 @@ public function detach(callable $listener, $identifier = null, $eventName = null if (! is_string($identifier) || empty($identifier)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid identifier provided; must be a string, received %s', - is_object($identifier) ? $identifier::class : gettype($identifier) + get_debug_type($identifier), )); } @@ -112,7 +111,7 @@ public function detach(callable $listener, $identifier = null, $eventName = null if (! is_string($eventName) || empty($eventName)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid event name provided; must be a string, received %s', - is_object($eventName) ? $eventName::class : gettype($eventName) + get_debug_type($eventName), )); } diff --git a/test/AbstractListenerAggregateTest.php b/test/AbstractListenerAggregateTest.php index bca2bb0..a9d2c1d 100644 --- a/test/AbstractListenerAggregateTest.php +++ b/test/AbstractListenerAggregateTest.php @@ -4,10 +4,50 @@ namespace LaminasTest\EventManager; -use Laminas\EventManager\ListenerAggregateInterface; +use Laminas\EventManager\EventManagerInterface; +use LaminasTest\EventManager\TestAsset\MockAbstractListenerAggregate; +use PHPUnit\Framework\TestCase; -class AbstractListenerAggregateTest extends ListenerAggregateTraitTest +use function in_array; + +class AbstractListenerAggregateTest extends TestCase { - /** @var class-string */ - public $aggregateClass = TestAsset\MockAbstractListenerAggregate::class; + public function testDetachRemovesAttachedListeners(): void + { + $aggregate = new MockAbstractListenerAggregate(); + + $events = $this->createMock(EventManagerInterface::class); + $events->expects(self::atLeast(2)) + ->method('attach') + ->with( + self::callback(static function (string $value): bool { + self::assertTrue(in_array($value, ['foo.bar', 'foo.baz'], true)); + + return true; + }), + self::callback(static function (array $value) use ($aggregate): bool { + self::assertSame($aggregate, $value[0] ?? null); + self::assertSame('doFoo', $value[1] ?? null); + + return true; + }), + )->willReturnArgument(1); + + $events->expects(self::exactly(2)) + ->method('detach') + ->with([$aggregate, 'doFoo']); + + $aggregate->attach($events); + + $listeners = $aggregate->getCallbacks(); + self::assertCount(2, $listeners); + + foreach ($listeners as $listener) { + self::assertSame([$aggregate, 'doFoo'], $listener); + } + + $aggregate->detach($events); + + self::assertSame([], $aggregate->getCallbacks()); + } } diff --git a/test/FilterChainTest.php b/test/FilterChainTest.php index 4b5e039..be24aa1 100644 --- a/test/FilterChainTest.php +++ b/test/FilterChainTest.php @@ -98,14 +98,12 @@ public function testFilterIsPassedContextAndArguments(): void public function testInterceptingFilterShouldReceiveChain(): void { - /** @psalm-suppress UnusedClosureParam */ $this->filterchain->attach(function (self $context, array $params, mixed $chain) { self::assertInstanceOf(FilterIterator::class, $chain); }); $this->filterchain->run($this); } - /** @psalm-suppress UnusedClosureParam */ public function testFilteringStopsAsSoonAsAFilterFailsToCallNext(): void { $this->filterchain->attach(function ($context, $params, $chain) { diff --git a/test/ListenerAggregateTraitTest.php b/test/ListenerAggregateTraitTest.php index 4cbcde8..ccd7739 100644 --- a/test/ListenerAggregateTraitTest.php +++ b/test/ListenerAggregateTraitTest.php @@ -5,7 +5,6 @@ namespace LaminasTest\EventManager; use Laminas\EventManager\EventManagerInterface; -use Laminas\EventManager\ListenerAggregateInterface; use LaminasTest\EventManager\TestAsset\MockListenerAggregateTrait; use PHPUnit\Framework\TestCase; @@ -13,13 +12,9 @@ class ListenerAggregateTraitTest extends TestCase { - /** @var class-string */ - public $aggregateClass = MockListenerAggregateTrait::class; - public function testDetachRemovesAttachedListeners(): void { - $class = $this->aggregateClass; - $aggregate = new $class(); + $aggregate = new MockListenerAggregateTrait(); $events = $this->createMock(EventManagerInterface::class); $events->expects(self::atLeast(2)) @@ -45,7 +40,6 @@ public function testDetachRemovesAttachedListeners(): void $aggregate->attach($events); $listeners = $aggregate->getCallbacks(); - self::assertIsArray($listeners); self::assertCount(2, $listeners); foreach ($listeners as $listener) { diff --git a/test/SharedListenerIntegrationTest.php b/test/SharedListenerIntegrationTest.php index 6c3af63..d0c9908 100644 --- a/test/SharedListenerIntegrationTest.php +++ b/test/SharedListenerIntegrationTest.php @@ -6,6 +6,7 @@ use Laminas\EventManager\EventManager; use Laminas\EventManager\SharedEventManager; +use LaminasTest\EventManager\TestAsset\CountingListener; use PHPUnit\Framework\TestCase; use function array_rand; @@ -28,7 +29,7 @@ protected function setUp(): void public function testCanTriggerTheSameSharedListenerMultipleTimes(): void { - $listener = new TestAsset\CountingListener(); + $listener = new CountingListener(); $this->sharedEvents->attach('Foo', 'foo', $listener); $iterations = array_rand(range(5, 100)); @@ -43,7 +44,7 @@ public function testTriggeringSameEventMultipleTimesTriggersNewSharedListeners() $listeners = []; for ($i = 0; $i < 5; $i += 1) { - $listeners[$i] = $listener = new TestAsset\CountingListener(); + $listeners[$i] = $listener = new CountingListener(); $this->sharedEvents->attach('Foo', 'foo', $listener); $this->events->trigger('foo'); } @@ -61,13 +62,14 @@ public function testTriggeringSameEventMultipleTimesTriggersNewSharedListeners() public function testTriggeringSameEventMultipleTimesDoesNotTriggersDetachedSharedListeners(): void { + /** @var array $listeners */ $listeners = []; $identifiers = ['Foo', 'Bar', 'Baz']; $sharedEvents = new SharedEventManager(); $events = new EventManager($sharedEvents, $identifiers); for ($i = 0; $i < 5; $i += 1) { - $listeners[$i] = $listener = new TestAsset\CountingListener(); + $listeners[$i] = $listener = new CountingListener(); $listener->index = $i; $sharedEvents->attach('Foo', 'foo', $listener); } diff --git a/test/TestAsset/CountingListener.php b/test/TestAsset/CountingListener.php index 37f332b..5b349b5 100644 --- a/test/TestAsset/CountingListener.php +++ b/test/TestAsset/CountingListener.php @@ -4,16 +4,13 @@ namespace LaminasTest\EventManager\TestAsset; -use Laminas\EventManager\EventInterface; - class CountingListener { public int $count = 0; public int $index = 0; - /** @param string|EventInterface $e */ - public function __invoke($e): void + public function __invoke(): void { $this->count += 1; } diff --git a/test/TestAsset/Functor.php b/test/TestAsset/Functor.php deleted file mode 100644 index 4692aa3..0000000 --- a/test/TestAsset/Functor.php +++ /dev/null @@ -1,16 +0,0 @@ -listeners[] = $events->attach('foo.baz', [$this, 'doFoo']); } + /** @return callable[] */ public function getCallbacks(): array { return $this->listeners; diff --git a/test/TestAsset/MockAggregate.php b/test/TestAsset/MockAggregate.php deleted file mode 100644 index cc30c76..0000000 --- a/test/TestAsset/MockAggregate.php +++ /dev/null @@ -1,55 +0,0 @@ -priority = $priority; - - $listeners = []; - $listeners[] = $events->attach('foo.bar', [$this, 'fooBar']); - $listeners[] = $events->attach('foo.baz', [$this, 'fooBaz']); - - $this->listeners[ spl_object_hash($events) ] = $listeners; - - return __METHOD__; - } - - public function detach(EventManagerInterface $events): string - { - foreach ($this->listeners[ spl_object_hash($events) ] as $listener) { - $events->detach($listener); - } - - return __METHOD__; - } - - public function fooBar(): string - { - return __METHOD__; - } - - public function fooBaz(): string - { - return __METHOD__; - } -} diff --git a/test/TestAsset/MockEventManagerAwareTrait.php b/test/TestAsset/MockEventManagerAwareTrait.php index a9fc8c2..404d59b 100644 --- a/test/TestAsset/MockEventManagerAwareTrait.php +++ b/test/TestAsset/MockEventManagerAwareTrait.php @@ -6,23 +6,12 @@ use Laminas\EventManager\EventManagerAwareTrait; -/** - * @group Laminas_EventManager - */ -class MockEventManagerAwareTrait +final class MockEventManagerAwareTrait { use EventManagerAwareTrait; - /** @var string */ - protected $eventIdentifier = 'foo.bar'; - - /** @var bool */ - protected $defaultEventListenersCalled = false; - - public function getEventIdentifier(): string - { - return $this->eventIdentifier; - } + private string $eventIdentifier = 'foo.bar'; + private bool $defaultEventListenersCalled = false; public function setEventIdentifier(string $eventIdentifier): self { diff --git a/test/TestAsset/StaticEventsMock.php b/test/TestAsset/StaticEventsMock.php deleted file mode 100644 index 3f645fc..0000000 --- a/test/TestAsset/StaticEventsMock.php +++ /dev/null @@ -1,49 +0,0 @@ -