Skip to content

Commit 679e314

Browse files
authored
[Php71] Try to handle no variants on RemoveExtraParametersRector (#7803)
1 parent 9548641 commit 679e314

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ private function resolveMaximumAllowedParameterCount(
151151
$parameterCounts[] = count($parametersAcceptor->getParameters());
152152
}
153153

154+
// empty variants -> use max value possibly has to prevent removing arguments incorrectly
155+
if ($parameterCounts === [0]) {
156+
return PHP_INT_MAX;
157+
}
158+
154159
return max($parameterCounts);
155160
}
156161
}

0 commit comments

Comments
 (0)