diff --git a/src/Closures/NoParameterWithNullDefaultValueRule.php b/src/Closures/NoParameterWithNullDefaultValueRule.php index 74294c1a..219f057d 100644 --- a/src/Closures/NoParameterWithNullDefaultValueRule.php +++ b/src/Closures/NoParameterWithNullDefaultValueRule.php @@ -57,7 +57,7 @@ public function processNode( return []; } - return \array_map(static function (Node\Param $node): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -70,6 +70,6 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noParameterWithNullDefaultValue()->toString())->build(); - }, $params); + }, $params)); } } diff --git a/src/Closures/NoParameterWithNullableTypeDeclarationRule.php b/src/Closures/NoParameterWithNullableTypeDeclarationRule.php index 608c45c6..9aec52e3 100644 --- a/src/Closures/NoParameterWithNullableTypeDeclarationRule.php +++ b/src/Closures/NoParameterWithNullableTypeDeclarationRule.php @@ -53,7 +53,7 @@ public function processNode( return []; } - return \array_map(static function (Node\Param $node): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -66,7 +66,7 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noParameterWithNullableTypeDeclaration()->toString())->build(); - }, $params); + }, $params)); } private static function isNullable(Node\Param $node): bool diff --git a/src/Functions/NoParameterWithNullDefaultValueRule.php b/src/Functions/NoParameterWithNullDefaultValueRule.php index aec3299f..726efcb8 100644 --- a/src/Functions/NoParameterWithNullDefaultValueRule.php +++ b/src/Functions/NoParameterWithNullDefaultValueRule.php @@ -59,7 +59,7 @@ public function processNode( $functionName = $node->namespacedName; - return \array_map(static function (Node\Param $node) use ($functionName): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node) use ($functionName): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -73,6 +73,6 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noParameterWithNullDefaultValue()->toString())->build(); - }, $params); + }, $params)); } } diff --git a/src/Functions/NoParameterWithNullableTypeDeclarationRule.php b/src/Functions/NoParameterWithNullableTypeDeclarationRule.php index a90d6bf9..112bcbf4 100644 --- a/src/Functions/NoParameterWithNullableTypeDeclarationRule.php +++ b/src/Functions/NoParameterWithNullableTypeDeclarationRule.php @@ -55,7 +55,7 @@ public function processNode( $functionName = $node->namespacedName; - return \array_map(static function (Node\Param $node) use ($functionName): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node) use ($functionName): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -69,7 +69,7 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noParameterWithNullableTypeDeclaration()->toString())->build(); - }, $params); + }, $params)); } private static function isNullable(Node\Param $node): bool diff --git a/src/Methods/NoConstructorParameterWithDefaultValueRule.php b/src/Methods/NoConstructorParameterWithDefaultValueRule.php index 444ce2ac..e1991c3f 100644 --- a/src/Methods/NoConstructorParameterWithDefaultValueRule.php +++ b/src/Methods/NoConstructorParameterWithDefaultValueRule.php @@ -62,7 +62,7 @@ public function processNode( $classReflection = $scope->getClassReflection(); if ($classReflection->isAnonymous()) { - return \array_map(static function (Node\Param $node): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -75,12 +75,12 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noConstructorParameterWithDefaultValue()->toString())->build(); - }, $params); + }, $params)); } $className = $classReflection->getName(); - return \array_map(static function (Node\Param $node) use ($className): string { + return \array_values(\array_map(static function (Node\Param $node) use ($className): string { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -92,6 +92,6 @@ public function processNode( $className, $parameterName, ); - }, $params); + }, $params)); } } diff --git a/src/Methods/NoParameterWithNullDefaultValueRule.php b/src/Methods/NoParameterWithNullDefaultValueRule.php index 148b5f28..a407db1b 100644 --- a/src/Methods/NoParameterWithNullDefaultValueRule.php +++ b/src/Methods/NoParameterWithNullDefaultValueRule.php @@ -64,7 +64,7 @@ public function processNode( $classReflection = $scope->getClassReflection(); if ($classReflection->isAnonymous()) { - return \array_map(static function (Node\Param $node) use ($methodName): Rules\RuleError { + return \array_values(\array_map(static function (Node\Param $node) use ($methodName): Rules\RuleError { /** @var Node\Expr\Variable $variable */ $variable = $node->var; @@ -78,7 +78,7 @@ public function processNode( )); return $ruleErrorBuilder->identifier(ErrorIdentifier::noParameterWithNullDefaultValue()->toString())->build(); - }, $params); + }, $params)); } $className = $classReflection->getName();