chore: fix various qodana issues

This commit is contained in:
James Cole
2023-06-04 06:30:22 +02:00
parent 160c364d2a
commit 688ca8e374
20 changed files with 56 additions and 106 deletions

View File

@@ -55,8 +55,6 @@ class AccountController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(AccountRepositoryInterface::class);
$this->adminRepository = app(AdminAccountRepositoryInterface::class);
@@ -113,10 +111,10 @@ class AccountController extends Controller
}
// custom order.
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
usort(
$return,
function ($a, $b) use ($order) {
function ($a, $b) {
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
$pos_a = array_search($a['type'], $order, true);
$pos_b = array_search($b['type'], $order, true);