diff --git a/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php b/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php index 71d6e02022b..dd17169e1f5 100644 --- a/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php +++ b/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php @@ -151,6 +151,11 @@ private function resolveMaximumAllowedParameterCount( $parameterCounts[] = count($parametersAcceptor->getParameters()); } + // empty variants -> use max value possibly has to prevent removing arguments incorrectly + if ($parameterCounts === [0]) { + return PHP_INT_MAX; + } + return max($parameterCounts); } }