Skip to content

Commit

Permalink
Merge pull request #2261 from nextcloud/fix/php-warning-usort-bool-re…
Browse files Browse the repository at this point in the history
…turn

Fix a deprecation warning about returning bool from comparison function
  • Loading branch information
come-nc authored Mar 29, 2022
2 parents adb8eb4 + 73b27cb commit 3ac82dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public function getFileById($fileId, $userId = null): Node {
// Workaround to always open files with edit permissions if multiple occurences of
// the same file id are in the user home, ideally we should also track the path of the file when opening
usort($files, function (Node $a, Node $b) {
return ($a->getPermissions() & Constants::PERMISSION_UPDATE) < ($b->getPermissions() & Constants::PERMISSION_UPDATE);
return ($b->getPermissions() & Constants::PERMISSION_UPDATE) <=> ($a->getPermissions() & Constants::PERMISSION_UPDATE);
});

return array_shift($files);
Expand Down

0 comments on commit 3ac82dd

Please sign in to comment.