Skip to content

Commit

Permalink
Merge pull request #8736 from weirdan/simplify-issue-sorting
Browse files Browse the repository at this point in the history
Simplify issue sorting
  • Loading branch information
orklah committed Nov 23, 2022
2 parents 3b6faf9 + 8e941c1 commit 16ba298
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/Psalm/IssueBuffer.php
Expand Up @@ -574,21 +574,10 @@ public static function finish(
foreach (self::$issues_data as $file_path => $file_issues) {
usort(
$file_issues,
static function (IssueData $d1, IssueData $d2): int {
if ($d1->file_path === $d2->file_path) {
if ($d1->line_from === $d2->line_from) {
if ($d1->column_from === $d2->column_from) {
return 0;
}

return $d1->column_from > $d2->column_from ? 1 : -1;
}

return $d1->line_from > $d2->line_from ? 1 : -1;
}

return $d1->file_path > $d2->file_path ? 1 : -1;
}
static fn(IssueData $d1, IssueData $d2): int =>
[$d1->file_path, $d1->line_from, $d1->column_from]
<=>
[$d2->file_path, $d2->line_from, $d2->column_from]
);
self::$issues_data[$file_path] = $file_issues;
}
Expand Down

0 comments on commit 16ba298

Please sign in to comment.