From 853830505422eb56ca3b21063a257465b4bef6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Kie=C3=9Fling?= Date: Thu, 16 Jan 2025 13:44:33 +0100 Subject: [PATCH] Fix for: Violation of noParameterWithNullableTypeDeclaration rule identifies itself as "ergebnis.noParameterWithContainerTypeDeclaration" in PHPStan output - see ergebnis/phpstan-rules#901 --- CHANGELOG.md | 6 ++++++ src/Methods/NoParameterWithNullableTypeDeclarationRule.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9263092b..234d8d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`2.6.0...main`][2.6.0...main]. +### Fixed + +- Adjusted `Methods\NoParameterWithNullableTypeDeclarationRule` to use the appropriate error identifier ([#902]), by [@manuelkiessling] + ## [`2.6.0`][2.6.0] For a full diff see [`2.5.2...2.6.0`][2.5.2...2.6.0]. @@ -588,12 +592,14 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0]. [#891]: https://github.com/ergebnis/phpstan-rules/pull/891 [#895]: https://github.com/ergebnis/phpstan-rules/pull/895 [#897]: https://github.com/ergebnis/phpstan-rules/pull/897 +[#902]: https://github.com/ergebnis/phpstan-rules/pull/902 [@cosmastech]: https://github.com/cosmastech [@enumag]: https://github.com/enumag [@ergebnis]: https://github.com/ergebnis [@Great-Antique]: https://github.com/Great-Antique [@localheinz]: https://github.com/localheinz +[@manuelkiessling]: https://github.com/manuelkiessling [@nunomaduro]: https://github.com/nunomaduro [@rpkamp]: https://github.com/rpkamp [@Slamdunk]: https://github.com/Slamdunk diff --git a/src/Methods/NoParameterWithNullableTypeDeclarationRule.php b/src/Methods/NoParameterWithNullableTypeDeclarationRule.php index fdf5c5cb..632cd7be 100644 --- a/src/Methods/NoParameterWithNullableTypeDeclarationRule.php +++ b/src/Methods/NoParameterWithNullableTypeDeclarationRule.php @@ -73,7 +73,7 @@ public function processNode( ); return Rules\RuleErrorBuilder::message($message) - ->identifier(ErrorIdentifier::noParameterWithContainerTypeDeclaration()->toString()) + ->identifier(ErrorIdentifier::noParameterWithNullableTypeDeclaration()->toString()) ->build(); }, $parametersWithNullableTypeDeclaration); } @@ -95,7 +95,7 @@ public function processNode( ); return Rules\RuleErrorBuilder::message($message) - ->identifier(ErrorIdentifier::noParameterWithContainerTypeDeclaration()->toString()) + ->identifier(ErrorIdentifier::noParameterWithNullableTypeDeclaration()->toString()) ->build(); }, $parametersWithNullableTypeDeclaration); }