Code cleanup

This commit is contained in:
James Cole
2023-11-04 14:18:49 +01:00
parent 5a35960434
commit ba0843d0bb
211 changed files with 566 additions and 568 deletions

View File

@@ -123,7 +123,7 @@ class AccountController extends Controller
usort(
$allItems,
function (array $a, array $b): int {
static function (array $a, array $b): int {
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
$pos_a = array_search($a['type'], $order, true);
$pos_b = array_search($b['type'], $order, true);

View File

@@ -135,7 +135,7 @@ class CategoryController extends Controller
$return = array_values($return);
// order by native amount
usort($return, function (array $a, array $b) {
usort($return, static function (array $a, array $b) {
return (float)$a['native_amount'] < (float)$b['native_amount'] ? 1 : -1;
});
return response()->json($this->clean($return));