Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matronator committed Oct 12, 2023
1 parent 908bbeb commit 9190051
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Parsem/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,14 @@ public static function needsArguments(string $string, ?string $pattern = null):
private static function removeDuplicates(array $array): array
{
$uniqueValues = [];
foreach ($array as &$value) {
foreach ($array as $value) {
if (in_array($value, $uniqueValues)) {
$value = null;
} else {
$uniqueValues[] = $value;
}
}
unset($value);
return $array;
return $uniqueValues;
}

/**
Expand Down

0 comments on commit 9190051

Please sign in to comment.