mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix various phpstan errors.
This commit is contained in:
@@ -55,7 +55,7 @@ class FixUnevenAmount extends Command
|
||||
/** @var stdClass $entry */
|
||||
foreach ($journals as $entry) {
|
||||
$sum = (string)$entry->the_sum;
|
||||
if (!is_numeric($sum) || '' === $sum || str_contains($sum, 'e') || str_contains($sum, ',')) {
|
||||
if (!is_numeric($sum) || 0 === strlen($sum) || str_contains($sum, 'e') || str_contains($sum, ',')) {
|
||||
$message = sprintf(
|
||||
'Journal #%d has an invalid sum ("%s"). No sure what to do.',
|
||||
$entry->transaction_journal_id,
|
||||
|
||||
@@ -268,7 +268,7 @@ class ExportData extends Command
|
||||
private function getExportDirectory(): string
|
||||
{
|
||||
$directory = (string)$this->option('export_directory');
|
||||
if (null === $directory) {
|
||||
if ('' === $directory) {
|
||||
$directory = './';
|
||||
}
|
||||
if (!is_writable($directory)) {
|
||||
|
||||
@@ -501,8 +501,8 @@ class ForceDecimalSize extends Command
|
||||
|
||||
/** @var Transaction $item */
|
||||
foreach ($result as $item) {
|
||||
$value = $item->amount;
|
||||
if (null === $value) {
|
||||
$value = (string)$item->amount;
|
||||
if ('' === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
|
||||
@@ -35,7 +35,6 @@ use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class UpgradeCurrencyPreferences
|
||||
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||
*/
|
||||
class UpgradeCurrencyPreferences extends Command
|
||||
{
|
||||
@@ -71,7 +70,7 @@ class UpgradeCurrencyPreferences extends Command
|
||||
|
||||
$this->friendlyPositive('Currency preferences migrated.');
|
||||
|
||||
//$this->markAsExecuted();
|
||||
$this->markAsExecuted();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -246,14 +246,14 @@ class UpgradeLiabilitiesEight extends Command
|
||||
}
|
||||
|
||||
// overruled. No transaction will be deleted, ever.
|
||||
// code is kept in place so i can revisit my reasoning.
|
||||
// code is kept in place so I can revisit my reasoning.
|
||||
$delete = false;
|
||||
|
||||
if ($delete) {
|
||||
$service = app(TransactionGroupDestroyService::class);
|
||||
$service->destroy($journal->transactionGroup);
|
||||
$count++;
|
||||
}
|
||||
// if ($delete) {
|
||||
$service = app(TransactionGroupDestroyService::class);
|
||||
$service->destroy($journal->transactionGroup);
|
||||
$count++;
|
||||
// }
|
||||
}
|
||||
|
||||
return $count;
|
||||
|
||||
Reference in New Issue
Block a user