Skip to content

Commit 17d7c7a

Browse files
committed
Improve compatibility with PHPParser 4.13.0
1 parent 94adc1d commit 17d7c7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rules/StrictCalls/StrictFunctionCallsRule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ public function processNode(\PhpParser\Node $node, \PHPStan\Analyser\Scope $scop
4848
return [];
4949
}
5050

51-
if ($functionName === 'array_keys' && !array_key_exists(1, $node->args)) {
51+
if ($functionName === 'array_keys' && !array_key_exists(1, $node->getArgs())) {
5252
return [];
5353
}
5454

5555
$argumentPosition = $this->functionArguments[$functionName];
56-
if (!array_key_exists($argumentPosition, $node->args)) {
56+
if (!array_key_exists($argumentPosition, $node->getArgs())) {
5757
return [sprintf('Call to function %s() requires parameter #%d to be set.', $functionName, $argumentPosition + 1)];
5858
}
5959

60-
$argumentType = $scope->getType($node->args[$argumentPosition]->value);
60+
$argumentType = $scope->getType($node->getArgs()[$argumentPosition]->value);
6161
$trueType = new ConstantBooleanType(true);
6262
if (!$trueType->isSuperTypeOf($argumentType)->yes()) {
6363
return [sprintf('Call to function %s() requires parameter #%d to be true.', $functionName, $argumentPosition + 1)];

0 commit comments

Comments
 (0)