Skip to content

Commit

Permalink
Fix: Reset keys
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 13, 2024
1 parent 75b368d commit e0af30f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Classes/NoExtendsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ final class NoExtendsRule implements Rules\Rule
*/
public function __construct(array $classesAllowedToBeExtended)
{
$this->classesAllowedToBeExtended = \array_unique(\array_merge(
$this->classesAllowedToBeExtended = \array_values(\array_unique(\array_merge(
self::$defaultClassesAllowedToBeExtended,
\array_map(static function (string $classAllowedToBeExtended): string {
/** @var class-string $classAllowedToBeExtended */
return $classAllowedToBeExtended;
}, $classesAllowedToBeExtended),
));
)));
}

public function getNodeType(): string
Expand Down
8 changes: 4 additions & 4 deletions src/Methods/NoParameterWithContainerTypeDeclarationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public function __construct(
array $methodsAllowedToUseContainerTypeDeclarations
) {
$this->reflectionProvider = $reflectionProvider;
$this->interfacesImplementedByContainers = \array_filter(
$this->interfacesImplementedByContainers = \array_values(\array_filter(
\array_map(static function (string $interfaceImplementedByContainers): string {
return $interfaceImplementedByContainers;
}, $interfacesImplementedByContainers),
static function (string $interfaceImplementedByContainer): bool {
return \interface_exists($interfaceImplementedByContainer);
},
);
));
$this->methodsAllowedToUseContainerTypeDeclarations = $methodsAllowedToUseContainerTypeDeclarations;
}

Expand Down Expand Up @@ -83,7 +83,7 @@ public function processNode(
/** @var Reflection\ClassReflection $containingClass */
$containingClass = $scope->getClassReflection();

return \array_reduce(
return \array_values(\array_reduce(
$node->params,
function (array $errors, Node\Param $node) use ($scope, $containingClass, $methodName) {
$type = $node->type;
Expand Down Expand Up @@ -142,7 +142,7 @@ function (array $errors, Node\Param $node) use ($scope, $containingClass, $metho
return $errors;
},
[],
);
));
}

private static function createError(
Expand Down

0 comments on commit e0af30f

Please sign in to comment.