diff --git a/src/Rules/NoParamTypeRemovalRule.php b/src/Rules/NoParamTypeRemovalRule.php index 1bb14ad9..40ffb35b 100644 --- a/src/Rules/NoParamTypeRemovalRule.php +++ b/src/Rules/NoParamTypeRemovalRule.php @@ -48,6 +48,10 @@ public function processNode(Node $node, Scope $scope): array } $classMethodName = (string) $node->name; + if ($classMethodName === '__construct') { + return []; + } + $parentClassMethodReflection = $this->methodNodeAnalyser->matchFirstParentClassMethod($scope, $classMethodName); if (! $parentClassMethodReflection instanceof PhpMethodReflection) { return []; diff --git a/tests/Rules/NoParamTypeRemovalRule/Fixture/SkipConstruct.php b/tests/Rules/NoParamTypeRemovalRule/Fixture/SkipConstruct.php new file mode 100644 index 00000000..71bce546 --- /dev/null +++ b/tests/Rules/NoParamTypeRemovalRule/Fixture/SkipConstruct.php @@ -0,0 +1,20 @@ +