From 109083571de6102cb854b9975c1463551ef678d0 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 6 May 2024 14:10:52 +0200 Subject: [PATCH] Deprecate old NoopRule --- phpstan-baseline.neon | 16 ++++++++++++++++ src/Rules/DeadCode/NoopRule.php | 1 + 2 files changed, 17 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7300fbd87d..57004f9318 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1824,6 +1824,22 @@ parameters: count: 1 path: tests/PHPStan/Rules/Arrays/AppendedArrayKeyTypeRuleTest.php + - + message: """ + #^Instantiation of deprecated class PHPStan\\\\Rules\\\\DeadCode\\\\NoopRule\\: + Replaced by PHPStan\\\\Rules\\\\DeadCode\\\\BetterNoopRule$# + """ + count: 1 + path: tests/PHPStan/Rules/DeadCode/NoopRuleTest.php + + - + message: """ + #^Return type of method PHPStan\\\\Rules\\\\DeadCode\\\\NoopRuleTest\\:\\:getRule\\(\\) has typehint with deprecated class PHPStan\\\\Rules\\\\DeadCode\\\\NoopRule\\: + Replaced by PHPStan\\\\Rules\\\\DeadCode\\\\BetterNoopRule$# + """ + count: 1 + path: tests/PHPStan/Rules/DeadCode/NoopRuleTest.php + - message: "#^PHPDoc tag @var assumes the expression with type PHPStan\\\\Type\\\\Generic\\\\TemplateType is always PHPStan\\\\Type\\\\Generic\\\\TemplateMixedType but it's error\\-prone and dangerous\\.$#" count: 1 diff --git a/src/Rules/DeadCode/NoopRule.php b/src/Rules/DeadCode/NoopRule.php index b05eb401f9..34855261ef 100644 --- a/src/Rules/DeadCode/NoopRule.php +++ b/src/Rules/DeadCode/NoopRule.php @@ -10,6 +10,7 @@ use function sprintf; /** + * @deprecated Replaced by PHPStan\Rules\DeadCode\BetterNoopRule * @implements Rule */ class NoopRule implements Rule