From f2d6547bd04defb79ff8df01b9d701a3328589f9 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 16 Nov 2026 17:59:01 +0100 Subject: [PATCH] [Php82] Remove deprecated AddSensitiveParameterAttributeRector --- .../AddSensitiveParameterAttributeRector.php | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 rules/Php82/Rector/Param/AddSensitiveParameterAttributeRector.php diff --git a/rules/Php82/Rector/Param/AddSensitiveParameterAttributeRector.php b/rules/Php82/Rector/Param/AddSensitiveParameterAttributeRector.php deleted file mode 100644 index c6692b71252..00000000000 --- a/rules/Php82/Rector/Param/AddSensitiveParameterAttributeRector.php +++ /dev/null @@ -1,85 +0,0 @@ - $configuration - */ - public function configure(array $configuration): void - { - } - - public function getNodeTypes(): array - { - return [Param::class]; - } - - /** - * @param Node\Param $node - */ - public function refactor(Node $node): ?Param - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as matching sensitive parameters by name is vague and risky. Add the #[\SensitiveParameter] attribute per case instead', - self::class - )); - } - - public function getRuleDefinition(): RuleDefinition - { - return new RuleDefinition( - 'Add SensitiveParameter attribute to method and function configured parameters', - [ - new ConfiguredCodeSample( - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run(string $password) - { - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run(#[\SensitiveParameter] string $password) - { - } -} -CODE_SAMPLE - , - [ - self::SENSITIVE_PARAMETERS => ['password'], - ] - ), - - ] - ); - } - - public function provideMinPhpVersion(): int - { - return PhpVersion::PHP_82; - } -}