Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Various code cleanup.
James Cole66c13f35e76d
diff --git a/app/Console/Commands/UpgradeDatabase.php b/app/Console/Commands/UpgradeDatabase.phpindex 7294a247e3..74abc4e465 100644--- a/app/Console/Commands/UpgradeDatabase.php+++ b/app/Console/Commands/UpgradeDatabase.php@@ -251,15 +251,13 @@ class UpgradeDatabase extends Command*/public function updateTransferCurrencies(){- /** @var CurrencyRepositoryInterface $repository */- $repository = app(CurrencyRepositoryInterface::class);$set = TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')->where('transaction_types.type', TransactionType::TRANSFER)->get(['transaction_journals.*']);$set->each(- function (TransactionJournal $transfer) use ($repository) {+ function (TransactionJournal $transfer) {// select all "source" transactions:/** @var Collection $transactions */$transactions = $transfer->transactions()->where('amount', '<', 0)->get();diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.phpindex 00808beb34..71f1fdd796 100644--- a/app/Http/Requests/TagFormRequest.php+++ b/app/Http/Requests/TagFormRequest.php@@ -37,14 +37,13 @@ class TagFormRequest extends Request*/public function collectTagData(): array{+ $latitude = null;+ $longitude = null;+ $zoomLevel = null;if ($this->get('setTag') === 'true') {$latitude = $this->string('latitude');$longitude = $this->string('longitude');$zoomLevel = $this->integer('zoomLevel');- } else {- $latitude = null;- $longitude = null;- $zoomLevel = null;}$data = [diff --git a/app/Import/Specifics/RabobankDescription.php b/app/Import/Specifics/RabobankDescription.phpindex ec92580f74..5dd23cb512 100644--- a/app/Import/Specifics/RabobankDescription.php+++ b/app/Import/Specifics/RabobankDescription.php@@ -59,7 +59,8 @@ class RabobankDescription implements SpecificInterface);$row[6] = $alternateName;$row[10] = '';- } else {+ }+ if (!(strlen($oppositeAccount) < 1 && strlen($oppositeName) < 1)) {Log::debug('Rabobank specific: either opposite account or name are filled.');}diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex 62ad0b4a6b..4cf65c0519 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -137,10 +137,9 @@ class Amountif ($amount > 0) {return sprintf('<span class="text-success">%s</span>', $result);- } else {- if ($amount < 0) {- return sprintf('<span class="text-danger">%s</span>', $result);- }+ }+ if ($amount < 0) {+ return sprintf('<span class="text-danger">%s</span>', $result);}return sprintf('<span style="color:#999">%s</span>', $result);@@ -194,14 +193,13 @@ class Amount$cache->addProperty('getCurrencySymbol');if ($cache->has()) {return $cache->get(); // @codeCoverageIgnore- } else {- $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));- $currency = TransactionCurrency::where('code', $currencyPreference->data)->first();+ }+ $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));+ $currency = TransactionCurrency::where('code', $currencyPreference->data)->first();- $cache->store($currency->symbol);+ $cache->store($currency->symbol);- return $currency->symbol;- }+ return $currency->symbol;}/**diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.phpindex 68f2323396..0f6801f017 100644--- a/app/Support/FireflyConfig.php+++ b/app/Support/FireflyConfig.php@@ -100,14 +100,13 @@ class FireflyConfigCache::forget('ff-config-' . $name);return $item;- } else {- Log::debug('Exists already ', ['name' => $name]);- $config->data = $value;- $config->save();- Cache::forget('ff-config-' . $name);-- return $config;}+ Log::debug('Exists already ', ['name' => $name]);+ $config->data = $value;+ $config->save();+ Cache::forget('ff-config-' . $name);++ return $config;}