diff --git a/src/Methods/NoParameterWithNullableTypeDeclarationRule.php b/src/Methods/NoParameterWithNullableTypeDeclarationRule.php index d6407661..48eaed89 100644 --- a/src/Methods/NoParameterWithNullableTypeDeclarationRule.php +++ b/src/Methods/NoParameterWithNullableTypeDeclarationRule.php @@ -92,14 +92,14 @@ public function processNode( }, $parametersWithNullableTypeDeclaration); } - private static function hasNullableTypeDeclaration(Node\Param $node): bool + private static function hasNullableTypeDeclaration(Node\Param $parameter): bool { - if ($node->type instanceof Node\NullableType) { + if ($parameter->type instanceof Node\NullableType) { return true; } - if ($node->type instanceof Node\UnionType) { - foreach ($node->type->types as $type) { + if ($parameter->type instanceof Node\UnionType) { + foreach ($parameter->type->types as $type) { if (!$type instanceof Node\Identifier) { continue; }