Fix phpstan issues.

This commit is contained in:
James Cole
2025-01-03 15:04:15 +01:00
parent 394d0eabef
commit 7f6c03ce17
10 changed files with 18 additions and 67 deletions

View File

@@ -74,7 +74,7 @@ class ConvertsDatesToUTC extends Command
*/
public function handle(): int
{
$this->friendlyWarning('Please do not use this command.');
$this->friendlyWarning('Please do not use this command right now.');
return 0;
@@ -124,8 +124,8 @@ class ConvertsDatesToUTC extends Command
/** @var Carbon $date */
$date = Carbon::parse($item->{$field}, $item->{$timezoneField});
$date->setTimezone('UTC');
$item->{$field} = $date->format('Y-m-d H:i:s');
$item->{$timezoneField} = 'UTC';
$item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line
$item->{$timezoneField} = 'UTC'; // @phpstan-ignore-line
$item->save();
}
);

View File

@@ -62,7 +62,7 @@ class CorrectsNativeAmounts extends Command
*/
public function handle(): int
{
if (!config('cer.enabled')) {
if (false === config('cer.enabled')) {
$this->friendlyInfo('This command will not run because currency exchange rates are disabled.');
return 0;

View File

@@ -50,7 +50,7 @@ class CorrectsUnevenAmount extends Command
$this->convertOldStyleTransfers();
$this->fixUnevenAmounts();
$this->matchCurrencies();
if (config('firefly.feature_flags.running_balance_column')) {
if (true === config('firefly.feature_flags.running_balance_column')) {
$this->friendlyInfo('Will recalculate transaction running balance columns. This may take a LONG time. Please be patient.');
AccountBalanceCalculator::recalculateAll(false);
$this->friendlyInfo('Done recalculating transaction running balance columns.');