Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:23:00 +01:00
parent b27fe59ab4
commit 1667b88dcd
154 changed files with 277 additions and 322 deletions

View File

@@ -111,12 +111,13 @@ class AccountController extends Controller
// custom order.
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
usort(
$return, function ($a, $b) use ($order) {
$pos_a = array_search($a['type'], $order);
$pos_b = array_search($b['type'], $order);
$return,
function ($a, $b) use ($order) {
$pos_a = array_search($a['type'], $order, true);
$pos_b = array_search($b['type'], $order, true);
return $pos_a - $pos_b;
}
return $pos_a - $pos_b;
}
);
return response()->json($return);

View File

@@ -78,5 +78,4 @@ class BillController extends Controller
return response()->json($filtered->toArray());
}
}

View File

@@ -80,5 +80,4 @@ class ObjectGroupController extends Controller
return response()->json($return);
}
}

View File

@@ -113,7 +113,9 @@ class PiggyBankController extends Controller
'id' => (string) $piggy->id,
'name' => $piggy->name,
'name_with_balance' => sprintf(
'%s (%s / %s)', $piggy->name, app('amount')->formatAnything($currency, $currentAmount, false),
'%s (%s / %s)',
$piggy->name,
app('amount')->formatAnything($currency, $currentAmount, false),
app('amount')->formatAnything($currency, $piggy->targetamount, false),
),
'currency_id' => $currency->id,
@@ -126,5 +128,4 @@ class PiggyBankController extends Controller
return response()->json($response);
}
}

View File

@@ -77,5 +77,4 @@ class RecurrenceController extends Controller
return response()->json($response);
}
}

View File

@@ -77,5 +77,4 @@ class RuleController extends Controller
return response()->json($response);
}
}

View File

@@ -101,7 +101,7 @@ class TransactionController extends Controller
public function transactionsWithID(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = new Collection;
$result = new Collection();
if (is_numeric($data['query'])) {
// search for group, not journal.
$firstResult = $this->groupRepository->find((int) $data['query']);