Skip to content

Commit

Permalink
Run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
malteschlueter committed Nov 2, 2023
1 parent 2d20783 commit dac3d75
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,12 @@ private function createAssignRefArrayFromListReferences(
// Nested list. Combine with the nodes from the recursive call
/** @var List_ $nestedList */
$nestedList = $listItem->value;
$listNestedArrayIndexes = array_merge($nestedArrayIndexes, [$key]);
$newNodes = array_merge(
$newNodes,
$this->createAssignRefArrayFromListReferences(
$nestedList->items,
$exprVariable,
$listNestedArrayIndexes
)
);
$listNestedArrayIndexes = [...$nestedArrayIndexes, $key];
$newNodes = [...$newNodes, ...$this->createAssignRefArrayFromListReferences(
$nestedList->items,
$exprVariable,
$listNestedArrayIndexes
)];
}

return $newNodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function getDifferentParamTypeFromAncestorClass(Param $param, ClassMetho

// parent classes or implemented interfaces
/** @var ClassReflection[] $parentClassReflections */
$parentClassReflections = array_merge($classReflection->getParents(), $classReflection->getInterfaces());
$parentClassReflections = [...$classReflection->getParents(), ...$classReflection->getInterfaces()];

foreach ($parentClassReflections as $parentClassReflection) {
$parentReflectionMethod = $this->resolveParentReflectionMethod($parentClassReflection, $methodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function resolveDifferentAncestorReturnType(
$methodName = $this->getName($classMethod);

/** @var ClassReflection[] $parentClassesAndInterfaces */
$parentClassesAndInterfaces = array_merge($classReflection->getParents(), $classReflection->getInterfaces());
$parentClassesAndInterfaces = [...$classReflection->getParents(), ...$classReflection->getInterfaces()];

return $this->resolveMatchingReturnType($parentClassesAndInterfaces, $methodName, $classMethod, $returnType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ public function refactor(Node $node): ?Node
continue;
}

$collectInterfaces = array_merge(
$collectInterfaces,
$this->familyRelationsAnalyzer->getClassLikeAncestorNames($extend)
);
$collectInterfaces = [...$collectInterfaces, ...$this->familyRelationsAnalyzer->getClassLikeAncestorNames($extend)];
}

if (! $isCleaned) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private function addPropertyAssignsToConstructorClassMethod(

/** @var ClassMethod $constructorClassMethod */
$constructorClassMethod = $class->getMethod(MethodName::CONSTRUCT);
$constructorClassMethod->stmts = array_merge($assigns, (array) $constructorClassMethod->stmts);
$constructorClassMethod->stmts = [...$assigns, ...(array) $constructorClassMethod->stmts];
}

/**
Expand Down

0 comments on commit dac3d75

Please sign in to comment.