diff --git a/rules-tests/TypeDeclaration/Rector/ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/with_empty_array.php.inc b/rules-tests/TypeDeclaration/Rector/ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/with_empty_array.php.inc new file mode 100644 index 00000000000..934273ea39e --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/with_empty_array.php.inc @@ -0,0 +1,39 @@ +process([]); + } + + private function process($data) + { + } +} + +?> +----- +process([]); + } + + private function process(array $data) + { + } +} + +?> diff --git a/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php b/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php index f0864011f8e..cc19d5298b6 100644 --- a/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php +++ b/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php @@ -46,11 +46,6 @@ public function resolveStrictTypesFromCalls(array $calls): array } /** @var Arg $arg */ - if ($this->isEmptyArray($arg->value)) { - // skip empty array, as it doesn't add any value - continue; - } - $staticTypesByArgumentPosition[$position][] = $this->resolveStrictArgValueType($arg); } }