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

@@ -80,7 +80,7 @@ class EnableCurrencies extends Command
$found = array_values(
array_filter(
$found,
function (int $currencyId) {
static function (int $currencyId) {
return $currencyId !== 0;
}
)

View File

@@ -81,11 +81,11 @@ class FixAccountTypes extends Command
->leftJoin('account_types as destination_account_type', 'destination_account.account_type_id', '=', 'destination_account_type.id');
// list all valid combinations, those are allowed. So we select those which are broken.
$query->where(function (Builder $q) use ($expected) {
$query->where(static function (Builder $q) use ($expected) {
foreach ($expected as $transactionType => $info) {
foreach ($info as $source => $destinations) {
foreach ($destinations as $destination) {
$q->whereNot(function (Builder $q1) use ($transactionType, $source, $destination) {
$q->whereNot(static function (Builder $q1) use ($transactionType, $source, $destination) {
$q1->where('transaction_types.type', $transactionType);
$q1->where('source_account_type.type', $source);
$q1->where('destination_account_type.type', $destination);

View File

@@ -56,7 +56,7 @@ class FixUnevenAmount extends Command
foreach ($journals as $entry) {
$sum = (string)$entry->the_sum;
if (!is_numeric($sum) ||
0 === strlen($sum) || // @phpstan-ignore-line
'' === $sum || // @phpstan-ignore-line
str_contains($sum, 'e') ||
str_contains($sum, ',')) {
$message = sprintf(