Fix various phpmd issues.

This commit is contained in:
James Cole
2023-11-26 12:50:54 +01:00
parent 846c60fb85
commit 72ead65d9c
9 changed files with 44 additions and 22 deletions

View File

@@ -123,12 +123,12 @@ class AccountController extends Controller
usort(
$allItems,
static function (array $a, array $b): int {
static function (array $left, array $right): int {
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
$pos_a = (int)array_search($a['type'], $order, true);
$pos_b = (int)array_search($b['type'], $order, true);
$posLeft = (int)array_search($left['type'], $order, true);
$posRight = (int)array_search($right['type'], $order, true);
return $pos_a - $pos_b;
return $posLeft - $posRight;
}
);
return response()->json($allItems);

View File

@@ -84,6 +84,7 @@ class AccountController extends Controller
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws FireflyException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function dashboard(DateRequest $request): JsonResponse
{