diff --git a/.dev-tools/composer.json b/.dev-tools/composer.json index 3dfc4267..38084be4 100644 --- a/.dev-tools/composer.json +++ b/.dev-tools/composer.json @@ -3,17 +3,18 @@ "require": { "php": "^8.4", "ergebnis/composer-normalize": "^2.47", - "infection/infection": "^0.30.1", + "infection/infection": "^0.31.0", "kubawerlos/composer-smaller-lock": "^1.1.0", "kubawerlos/php-cs-fixer-config": "^5.3", "mi-schi/phpmd-extension": "^4.3", "phpmd/phpmd": "^2.15", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.1.17", - "phpstan/phpstan-phpunit": "^2.0.6", - "phpstan/phpstan-strict-rules": "^2.0.4", + "phpstan/phpstan": "^2.1.20", + "phpstan/phpstan-phpunit": "^2.0.7", + "phpstan/phpstan-strict-rules": "^2.0.6", "shipmonk/composer-dependency-analyser": "^1.8.3", - "shipmonk/phpstan-rules": "^4.1.4", + "shipmonk/dead-code-detector": "^0.13.0", + "shipmonk/phpstan-rules": "^4.1.5", "squizlabs/php_codesniffer": "^3.13.2", "tomasvotruba/type-coverage": "^2.0.2", "vimeo/psalm": "^6.13.0" diff --git a/.dev-tools/composer.lock b/.dev-tools/composer.lock index f3bb138b..af4ea41e 100644 --- a/.dev-tools/composer.lock +++ b/.dev-tools/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": "ab0b2efbd9f8b7f3444da6ac50cd0e93", + "content-hash": "cabbd0fae4aead7a24da14b5c9edda96", "packages": [ { "name": "amphp/amp", @@ -1006,16 +1006,16 @@ }, { "name": "infection/infection", - "version": "0.30.1", + "version": "0.31.0", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "70cd94675f6372cf13962d9d52de86b02a909c09" + "reference": "94ef40f9d469d2d0f20f82081f700b0754ad949a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/70cd94675f6372cf13962d9d52de86b02a909c09", - "reference": "70cd94675f6372cf13962d9d52de86b02a909c09" + "url": "https://api.github.com/repos/infection/infection/zipball/94ef40f9d469d2d0f20f82081f700b0754ad949a", + "reference": "94ef40f9d469d2d0f20f82081f700b0754ad949a" }, "require": { "colinodell/json5": "^2.2 || ^3.0", @@ -1034,8 +1034,10 @@ "nikic/php-parser": "^5.3", "ondram/ci-detector": "^4.1.0", "php": "^8.2", + "sanmai/di-container": "^0.1.4", + "sanmai/duoclock": "^0.1.0", "sanmai/later": "^0.1.7", - "sanmai/pipeline": "^6.16", + "sanmai/pipeline": "^6.22 || ^7.0", "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0 || ^6.0 || ^7.0", "symfony/console": "^6.4 || ^7.0", "symfony/filesystem": "^6.4 || ^7.0", @@ -1221,21 +1223,21 @@ }, { "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.29.2", + "version": "v3.31.1", "source": { "type": "git", "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "0774fabfdf5e487c170bacfcc03f8e439a960f9a" + "reference": "207182775ff9121dafc1c8c3b28e9d3f2f567fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/0774fabfdf5e487c170bacfcc03f8e439a960f9a", - "reference": "0774fabfdf5e487c170bacfcc03f8e439a960f9a" + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/207182775ff9121dafc1c8c3b28e9d3f2f567fe1", + "reference": "207182775ff9121dafc1c8c3b28e9d3f2f567fe1" }, "require": { "ext-filter": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.77", + "friendsofphp/php-cs-fixer": "^3.84", "php": "^7.4 || ^8.0" }, "type": "library", @@ -1475,16 +1477,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.5.0", + "version": "v5.6.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" + "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/221b0d0fdf1369c71047ad1d18bb5880017bbc56", + "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56" }, "require": { "ext-ctype": "*", @@ -1579,16 +1581,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.80.0", + "version": "v3.84.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "050bfba7a3f1716522075118a60e934344053b34" + "reference": "8208dabb176cbc03a76df5a908220dfb75c0af9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/050bfba7a3f1716522075118a60e934344053b34", - "reference": "050bfba7a3f1716522075118a60e934344053b34" + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/8208dabb176cbc03a76df5a908220dfb75c0af9a", + "reference": "8208dabb176cbc03a76df5a908220dfb75c0af9a" }, "require": { "ext-json": "*", @@ -1780,16 +1782,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" }, "require": { "php": "^7.4 || ^8.0" @@ -1809,16 +1811,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.17", + "version": "2.1.20", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053" + "reference": "a9ccfef95210f92ba6feea6e8d1eef42b5605499" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053", - "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053" + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a9ccfef95210f92ba6feea6e8d1eef42b5605499", + "reference": "a9ccfef95210f92ba6feea6e8d1eef42b5605499" }, "require": { "php": "^7.4|^8.0" @@ -1840,20 +1842,20 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "6b92469f8a7995e626da3aa487099617b8dfa260" + "reference": "9a9b161baee88a5f5c58d816943cff354ff233dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6b92469f8a7995e626da3aa487099617b8dfa260", - "reference": "6b92469f8a7995e626da3aa487099617b8dfa260" + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9a9b161baee88a5f5c58d816943cff354ff233dc", + "reference": "9a9b161baee88a5f5c58d816943cff354ff233dc" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0.4" + "phpstan/phpstan": "^2.1.18" }, "type": "phpstan-extension", "extra": { @@ -1876,16 +1878,16 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.4", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a" + "reference": "f9f77efa9de31992a832ff77ea52eb42d675b094" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/3e139cbe67fafa3588e1dbe27ca50f31fdb6236a", - "reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a" + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/f9f77efa9de31992a832ff77ea52eb42d675b094", + "reference": "f9f77efa9de31992a832ff77ea52eb42d675b094" }, "require": { "php": "^7.4 || ^8.0", @@ -1909,6 +1911,33 @@ ], "description": "Extra strict and opinionated rules for PHPStan" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "license": [ + "MIT" + ], + "description": "Common interface for reading the clock." + }, { "name": "psr/container", "version": "2.0.2", @@ -2070,6 +2099,72 @@ ], "description": "Rock-solid event loop for concurrent PHP applications." }, + { + "name": "sanmai/di-container", + "version": "0.1.4", + "source": { + "type": "git", + "url": "https://github.com/sanmai/di-container.git", + "reference": "7141a28f33d72dd7a9e3148e32a8b54b93050453" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/di-container/zipball/7141a28f33d72dd7a9e3148e32a8b54b93050453", + "reference": "7141a28f33d72dd7a9e3148e32a8b54b93050453" + }, + "require": { + "php": ">=8.2", + "psr/container": "^2.0", + "sanmai/pipeline": "^6.17 || ^7.0" + }, + "type": "library", + "extra": { + "preferred-install": "dist" + }, + "autoload": { + "psr-4": { + "DIContainer\\": "src/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "Straightforward DI container with autowiring" + }, + { + "name": "sanmai/duoclock", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/sanmai/DuoClock.git", + "reference": "30aa40092396dc96b68c8e8d49162619574477e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/DuoClock/zipball/30aa40092396dc96b68c8e8d49162619574477e2", + "reference": "30aa40092396dc96b68c8e8d49162619574477e2" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "extra": { + "preferred-install": "dist" + }, + "autoload": { + "psr-4": { + "DuoClock\\": "src/" + } + }, + "license": [ + "Apache-2.0" + ], + "description": "PHP time mocking for tests - PSR-20 clock with mockable sleep(), time(), and TimeSpy for PHPUnit testing" + }, { "name": "sanmai/later", "version": "0.1.7", @@ -2107,16 +2202,16 @@ }, { "name": "sanmai/pipeline", - "version": "6.19", + "version": "7.1", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "3707180c66dd6b3b9c4b5f9fe26155325812037d" + "reference": "d01565ef9f5cd7d1019c5f8bee09497067511f36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/3707180c66dd6b3b9c4b5f9fe26155325812037d", - "reference": "3707180c66dd6b3b9c4b5f9fe26155325812037d" + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/d01565ef9f5cd7d1019c5f8bee09497067511f36", + "reference": "d01565ef9f5cd7d1019c5f8bee09497067511f36" }, "require": { "php": ">=8.2" @@ -2204,18 +2299,53 @@ ], "description": "Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)" }, + { + "name": "shipmonk/dead-code-detector", + "version": "0.13.0", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/dead-code-detector.git", + "reference": "d7cf34827e29aeb977260c01ce8f12a7d17fa7e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/d7cf34827e29aeb977260c01ce8f12a7d17fa7e6", + "reference": "d7cf34827e29aeb977260c01ce8f12a7d17fa7e6" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.12" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "ShipMonk\\PHPStan\\DeadCode\\": "src/" + } + }, + "license": [ + "MIT" + ], + "description": "Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested." + }, { "name": "shipmonk/phpstan-rules", - "version": "4.1.4", + "version": "4.1.5", "source": { "type": "git", "url": "https://github.com/shipmonk-rnd/phpstan-rules.git", - "reference": "69059a59c0a6ae2091bd279b2507a579fded835a" + "reference": "9a2a033d12a516a73056bb215e6e4dec0dd33701" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shipmonk-rnd/phpstan-rules/zipball/69059a59c0a6ae2091bd279b2507a579fded835a", - "reference": "69059a59c0a6ae2091bd279b2507a579fded835a" + "url": "https://api.github.com/repos/shipmonk-rnd/phpstan-rules/zipball/9a2a033d12a516a73056bb215e6e4dec0dd33701", + "reference": "9a2a033d12a516a73056bb215e6e4dec0dd33701" }, "require": { "php": "^7.4 || ^8.0", diff --git a/.dev-tools/src/InfectionConfigBuilder.php b/.dev-tools/src/InfectionConfigBuilder.php index beddac05..8ebba8d6 100644 --- a/.dev-tools/src/InfectionConfigBuilder.php +++ b/.dev-tools/src/InfectionConfigBuilder.php @@ -31,6 +31,7 @@ final class InfectionConfigBuilder 'NotIdenticalNotEqual', 'OneZeroInteger', 'Plus', + 'ReturnRemoval', 'SyntaxError', ];