Skip to content

Commit 7734e07

Browse files
committed
Changing debug refs not to invalidate result cache
1 parent 1a94628 commit 7734e07

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"php": "^7.4 || ^8.0",
16-
"phpstan/phpstan": "^2.1.7"
16+
"phpstan/phpstan": "2.1.x-dev"
1717
},
1818
"require-dev": {
1919
"composer-runtime-api": "^2.0",

composer.lock

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rules.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ services:
121121

122122

123123
parameters:
124+
parametersNotInvalidatingCache:
125+
- parameters.shipmonkDeadCode.debug.usagesOf
124126
shipmonkDeadCode:
125127
trackMixedAccess: null
126128
reportTransitivelyDeadMethodAsSeparateError: false

src/Provider/ReflectionUsageProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function extractConstantsUsedByReflection(
107107
}
108108

109109
if (($methodName === 'getConstant' || $methodName === 'getReflectionConstant') && count($args) === 1) {
110-
$firstArg = $args[array_key_first($args)]; // @phpstan-ignore offsetAccess.notFound
110+
$firstArg = $args[array_key_first($args)];
111111

112112
foreach ($scope->getType($firstArg->value)->getConstantStrings() as $constantString) {
113113
$usedConstants[] = $this->createConstantUsage($node, $scope, $genericReflection->getName(), $constantString->getValue());
@@ -138,7 +138,7 @@ private function extractMethodsUsedByReflection(
138138
}
139139

140140
if ($methodName === 'getMethod' && count($args) === 1) {
141-
$firstArg = $args[array_key_first($args)]; // @phpstan-ignore offsetAccess.notFound
141+
$firstArg = $args[array_key_first($args)];
142142

143143
foreach ($scope->getType($firstArg->value)->getConstantStrings() as $constantString) {
144144
$usedMethods[] = $this->createMethodUsage($node, $scope, $genericReflection->getName(), $constantString->getValue());

0 commit comments

Comments
 (0)