diff --git a/src/Analyser/ArgumentsNormalizer.php b/src/Analyser/ArgumentsNormalizer.php index 7b8f4259fa..908e5747c5 100644 --- a/src/Analyser/ArgumentsNormalizer.php +++ b/src/Analyser/ArgumentsNormalizer.php @@ -235,11 +235,10 @@ public static function reorderArgs(ParametersAcceptor $parametersAcceptor, array null, ); } elseif (array_key_exists($arg->name->toString(), $argumentPositions)) { - $argName = $arg->name->toString(); // order named args into the position the signature expects them $attributes = $arg->getAttributes(); $attributes[self::ORIGINAL_ARG_ATTRIBUTE] = $arg; - $reorderedArgs[$argumentPositions[$argName]] = new Arg( + $reorderedArgs[$argumentPositions[$arg->name->toString()]] = new Arg( $arg->value, $arg->byRef, $arg->unpack, diff --git a/src/Fixable/PhpPrinterIndentationDetectorVisitor.php b/src/Fixable/PhpPrinterIndentationDetectorVisitor.php index af696b5b95..318d899477 100644 --- a/src/Fixable/PhpPrinterIndentationDetectorVisitor.php +++ b/src/Fixable/PhpPrinterIndentationDetectorVisitor.php @@ -7,9 +7,9 @@ use PhpParser\Node; use PhpParser\NodeVisitor; use PhpParser\NodeVisitorAbstract; +use function array_is_list; use function count; use function in_array; -use function is_array; use function preg_match; use function preg_match_all; use function property_exists; @@ -37,7 +37,7 @@ public function enterNode(Node $node): ?int return null; } - if (!is_array($node->stmts) || count($node->stmts) === 0) { + if (!array_is_list($node->stmts) || count($node->stmts) === 0) { return null; } diff --git a/src/Type/Php/StrTokFunctionReturnTypeExtension.php b/src/Type/Php/StrTokFunctionReturnTypeExtension.php index 01af622932..4b6ee09e5e 100644 --- a/src/Type/Php/StrTokFunctionReturnTypeExtension.php +++ b/src/Type/Php/StrTokFunctionReturnTypeExtension.php @@ -31,7 +31,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, return null; } - $delimiterType = $scope->getType($functionCall->getArgs()[0]->value); + $delimiterType = $scope->getType($args[0]->value); $isEmptyString = (new ConstantStringType(''))->isSuperTypeOf($delimiterType); if ($isEmptyString->yes()) { return new ConstantBooleanType(false);