From 5e06a1af4f7e2759039ba45c3b74072ac619d92c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 29 Aug 2026 19:38:10 +0200 Subject: [PATCH 1/2] Move cheaper-guard ignore from inline annotation to phpstan.neon Claude-Session: https://claude.ai/code/session_01Na4eYvNqa2pdhZrBXbegrv --- phpstan.neon | 5 +++++ .../Rector/FuncCall/DowngradeSubstrFalsyRector.php | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 88649322..059551fe 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -111,3 +111,8 @@ parameters: # local attribute key - '#Parameter \#2 \$attributeKey of static method Rector\\PhpParser\\NodeTraverser\\SimpleNodeTraverser\:\:decorateWithAttributeValue\(\) expects#' + + # guard cannot hoist above the CallLike block that marks IS_FALSY_UNCASTABLE on non-substr nodes + - + identifier: rector.rectorCheaperGuardsFirst + path: rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php diff --git a/rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php b/rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php index 4678d903..1f421208 100644 --- a/rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php +++ b/rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php @@ -178,7 +178,6 @@ public function refactor(Node $node): ?Node } } - // @phpstan-ignore rector.rectorCheaperGuardsFirst (cannot hoist above the CallLike block, which marks IS_FALSY_UNCASTABLE on non-substr nodes) if (! $this->isName($node, 'substr')) { return null; } From c69f74de44fa2ba5d39402cb1b537e85fd8c9313 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 29 Aug 2026 19:46:17 +0200 Subject: [PATCH 2/2] Drop cheaper-guard ignore, rely on fixed rule in symplify/phpstan-rules 14.13.1 Claude-Session: https://claude.ai/code/session_01Na4eYvNqa2pdhZrBXbegrv --- composer.json | 2 +- phpstan.neon | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 035f1072..97be7266 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "rector/swiss-knife": "^2.4", "symplify/easy-coding-standard": "^13.2", "symplify/phpstan-extensions": "^12.0", - "symplify/phpstan-rules": "^14.12", + "symplify/phpstan-rules": "^14.13.1", "symplify/rule-doc-generator": "^12.2", "tomasvotruba/class-leak": "^2.1", "tomasvotruba/type-coverage": "^2.3", diff --git a/phpstan.neon b/phpstan.neon index 059551fe..88649322 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -111,8 +111,3 @@ parameters: # local attribute key - '#Parameter \#2 \$attributeKey of static method Rector\\PhpParser\\NodeTraverser\\SimpleNodeTraverser\:\:decorateWithAttributeValue\(\) expects#' - - # guard cannot hoist above the CallLike block that marks IS_FALSY_UNCASTABLE on non-substr nodes - - - identifier: rector.rectorCheaperGuardsFirst - path: rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php