Skip to content

Commit 555170a

Browse files
committed
handle case the same flag is written multiple times
1 parent f4dd08d commit 555170a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rules/Php73/Rector/FuncCall/JsonThrowOnErrorRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private function getFlags(Expr|Arg $arg, array $flags = []): array
215215
$flags = $this->getFlags($arg->left, $flags);
216216
$flags = $this->getFlags($arg->right, $flags);
217217
}
218-
return $flags;
218+
return array_values(array_unique($flags)); // array_unique is case the same flag is written multiple times
219219
}
220220

221221
/**

0 commit comments

Comments
 (0)