Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(FixInstructionsFilter): Prevent accidentally calling array_merge(…
…) with named arguments

Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and christianlupus committed Mar 5, 2025
commit 669ad12b4b4868c3a732f4287e6175fbe6e84262
4 changes: 2 additions & 2 deletions lib/Helper/Filter/JSON/FixInstructionsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function apply(array &$json): bool {
}

ksort($instructions);
$instructions = array_merge(...$instructions);
$instructions = array_merge([], ...$instructions);
}

$instructions = array_map(function ($x) {
Expand Down Expand Up @@ -160,7 +160,7 @@ private function flattenItemList(array $list): array {
}

ksort($newElements);
$elements = array_merge(...$newElements);
$elements = array_merge([], ...$newElements);

return $elements;
}
Expand Down
6 changes: 0 additions & 6 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<code><![CDATA[is_array($keywords)]]></code>
</RedundantCondition>
</file>
<file src="lib/Helper/Filter/JSON/FixInstructionsFilter.php">
<NamedArgumentNotAllowed>
<code><![CDATA[$instructions]]></code>
<code><![CDATA[$newElements]]></code>
</NamedArgumentNotAllowed>
</file>
<file src="lib/Helper/UserFolderHelper.php">
<MissingDependency>
<code><![CDATA[$this->root]]></code>
Expand Down