mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fix various level 4 issues [skip ci]
This commit is contained in:
@@ -62,7 +62,11 @@ class ConvertsDatesToUTC extends Command
|
||||
{
|
||||
$this->friendlyWarning('Please do not use this command right now.');
|
||||
|
||||
return 0;
|
||||
// this variable is ALWAYS en_US.
|
||||
// stops phpstan complaining about dead code.
|
||||
if (config('app.fallback_locale') === 'en_US') {
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string $model
|
||||
@@ -108,10 +112,10 @@ class ConvertsDatesToUTC extends Command
|
||||
$items->each(
|
||||
function ($item) use ($field, $timezoneField): void {
|
||||
/** @var Carbon $date */
|
||||
$date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line
|
||||
$date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line
|
||||
$date->setTimezone('UTC');
|
||||
$item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line
|
||||
$item->{$timezoneField} = 'UTC'; // @phpstan-ignore-line
|
||||
$item->{$timezoneField} = 'UTC'; // @phpstan-ignore-line
|
||||
$item->save();
|
||||
}
|
||||
);
|
||||
|
@@ -61,12 +61,7 @@ class ReportsSums extends Command
|
||||
$sum = '' === $sum ? '0' : $sum;
|
||||
$foreign = '' === $foreign ? '0' : $foreign;
|
||||
$total = bcadd($sum, $foreign);
|
||||
if (!is_numeric($total)) {
|
||||
$message = sprintf('Error: Transactions for user #%d (%s) have an invalid sum ("%s").', $user->id, $user->email, $total);
|
||||
$this->friendlyError($message);
|
||||
|
||||
continue;
|
||||
}
|
||||
if (0 !== bccomp($total, '0')) {
|
||||
$message = sprintf('Error: Transactions for user #%d (%s) are off by %s!', $user->id, $user->email, $total);
|
||||
$this->friendlyError($message);
|
||||
|
@@ -240,7 +240,7 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
private function isMultiCurrency(Account $account): bool
|
||||
{
|
||||
$value = $this->accountRepos->getMetaValue($account, 'is_multi_currency');
|
||||
if (false === $value || null === $value) {
|
||||
if (null === $value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user