diff --git a/README.md b/README.md index bdfaeacb..cb8c3c78 100644 --- a/README.md +++ b/README.md @@ -390,6 +390,9 @@ App\User\Entity\Address::__construct If you set up `editorUrl` [parameter](https://phpstan.org/user-guide/output-format#opening-file-in-an-editor), you can click on the usages to open it in your IDE. +> [!TIP] +> You can change the list of debug references without affecting result cache, so rerun is instant! + ## Future scope: - Dead class property detection - Dead class detection diff --git a/composer.json b/composer.json index e056d04b..6dfe787d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.7" + "phpstan/phpstan": "^2.1.9" }, "require-dev": { "composer-runtime-api": "^2.0", diff --git a/composer.lock b/composer.lock index aec789e5..f243dea8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3db2a7de56d94f1fafe36b2922a91afd", + "content-hash": "c99cce62513777890267fe702e9f35a4", "packages": [ { "name": "phpstan/phpstan", - "version": "2.1.7", + "version": "2.1.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "12567f91a74036d56ba0af6d56c8e73ac0e8d850" + "reference": "051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/12567f91a74036d56ba0af6d56c8e73ac0e8d850", - "reference": "12567f91a74036d56ba0af6d56c8e73ac0e8d850", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f", + "reference": "051a3b6b9b80df4ba3a7f801a8b53ad7d8f1c15f", "shasum": "" }, "require": { @@ -62,7 +62,7 @@ "type": "github" } ], - "time": "2025-03-05T13:43:55+00:00" + "time": "2025-03-23T14:57:55+00:00" } ], "packages-dev": [ diff --git a/rules.neon b/rules.neon index 5b574a63..e75713c5 100644 --- a/rules.neon +++ b/rules.neon @@ -121,6 +121,9 @@ services: parameters: + parametersNotInvalidatingCache: + - parameters.shipmonkDeadCode.debug.usagesOf + - parameters.shipmonkDeadCode.reportTransitivelyDeadMethodAsSeparateError shipmonkDeadCode: trackMixedAccess: null reportTransitivelyDeadMethodAsSeparateError: false diff --git a/src/Provider/ReflectionUsageProvider.php b/src/Provider/ReflectionUsageProvider.php index a5f9a211..ffab0591 100644 --- a/src/Provider/ReflectionUsageProvider.php +++ b/src/Provider/ReflectionUsageProvider.php @@ -107,7 +107,7 @@ private function extractConstantsUsedByReflection( } if (($methodName === 'getConstant' || $methodName === 'getReflectionConstant') && count($args) === 1) { - $firstArg = $args[array_key_first($args)]; // @phpstan-ignore offsetAccess.notFound + $firstArg = $args[array_key_first($args)]; foreach ($scope->getType($firstArg->value)->getConstantStrings() as $constantString) { $usedConstants[] = $this->createConstantUsage($node, $scope, $genericReflection->getName(), $constantString->getValue()); @@ -138,7 +138,7 @@ private function extractMethodsUsedByReflection( } if ($methodName === 'getMethod' && count($args) === 1) { - $firstArg = $args[array_key_first($args)]; // @phpstan-ignore offsetAccess.notFound + $firstArg = $args[array_key_first($args)]; foreach ($scope->getType($firstArg->value)->getConstantStrings() as $constantString) { $usedMethods[] = $this->createMethodUsage($node, $scope, $genericReflection->getName(), $constantString->getValue());