diff --git a/rules-tests/TypeDeclarationDocblocks/Rector/Class_/ClassMethodArrayDocblockParamFromLocalCallsRector/Fixture/skip_mixed_array_from_getter.php.inc b/rules-tests/TypeDeclarationDocblocks/Rector/Class_/ClassMethodArrayDocblockParamFromLocalCallsRector/Fixture/skip_mixed_array_from_getter.php.inc new file mode 100644 index 00000000000..c0b64f17bb0 --- /dev/null +++ b/rules-tests/TypeDeclarationDocblocks/Rector/Class_/ClassMethodArrayDocblockParamFromLocalCallsRector/Fixture/skip_mixed_array_from_getter.php.inc @@ -0,0 +1,19 @@ +run($this->getter()); + } + + private function run(array $p) + { + } +} \ No newline at end of file diff --git a/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php b/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php index fef791d7368..8e71843aafb 100644 --- a/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php +++ b/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php @@ -228,6 +228,14 @@ private function isEmptyArray(Expr $expr): bool private function isArrayMixedMixedType(Type $type): bool { if (! $type instanceof ArrayType) { + if ($type instanceof UnionType) { + foreach ($type->getTypes() as $subType) { + if ($subType instanceof ArrayType && $this->isArrayMixedMixedType($subType)) { + return true; + } + } + } + return false; }