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

@@ -118,7 +118,7 @@ class AccountController extends Controller
// custom order.
usort(
$return,
function ($a, $b) {
static function ($a, $b) {
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
$posA = array_search($a['type'], $order, true);
$posB = array_search($b['type'], $order, true);

View File

@@ -88,8 +88,8 @@ abstract class Controller extends BaseController
if ($page < 1) {
$page = 1;
}
if ($page > pow(2, 16)) {
$page = pow(2, 16);
if ($page > 2** 16) {
$page = 2** 16;
}
$bag->set('page', $page);

View File

@@ -255,7 +255,7 @@ class ListController extends Controller
$unfiltered = $recurringRepos->getAll();
// filter selection
$collection = $unfiltered->filter( // @phpstan-ignore-line
$collection = $unfiltered->filter( /** @phpstan-ignore-line */
static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line
/** @var RecurrenceTransaction $transaction */
foreach ($recurrence->recurrenceTransactions as $transaction) {
@@ -305,7 +305,7 @@ class ListController extends Controller
$ruleRepos = app(RuleRepositoryInterface::class);
$unfiltered = $ruleRepos->getAll();
$collection = $unfiltered->filter( // @phpstan-ignore-line
$collection = $unfiltered->filter( /** @phpstan-ignore-line */
static function (Rule $rule) use ($currency) { // @phpstan-ignore-line
/** @var RuleTrigger $trigger */
foreach ($rule->ruleTriggers as $trigger) {