mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
Various code cleanup.
This commit is contained in:
@@ -54,7 +54,6 @@ class AddsTransactionIdentifiers extends Command
|
||||
* When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more
|
||||
* often than you would think. So each set gets a number (1,2,3) to keep them apart.
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@@ -101,11 +100,8 @@ class AddsTransactionIdentifiers extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,11 +99,8 @@ class RemovesDatabaseDecryption extends Command
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function decryptField(string $table, string $field): void
|
||||
|
||||
@@ -100,7 +100,6 @@ class UpgradesAccountCurrencies extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function updateCurrenciesForUser(User $user): void
|
||||
{
|
||||
|
||||
@@ -83,11 +83,8 @@ class UpgradesAccountMetaData extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function markAsExecuted(): void
|
||||
|
||||
@@ -93,11 +93,8 @@ class UpgradesAttachments extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function markAsExecuted(): void
|
||||
|
||||
@@ -99,17 +99,13 @@ class UpgradesBillsToRules extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate bills to new rule structure for a specific user.
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function migrateUser(User $user): void
|
||||
{
|
||||
|
||||
@@ -85,11 +85,8 @@ class UpgradesBudgetLimits extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function markAsExecuted(): void
|
||||
|
||||
@@ -66,11 +66,8 @@ class UpgradesCurrencyPreferences extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool)$configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function runUpgrade(): void
|
||||
|
||||
@@ -87,11 +87,8 @@ class UpgradesJournalNotes extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function markAsExecuted(): void
|
||||
|
||||
@@ -62,11 +62,8 @@ class UpgradesLiabilities extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function upgradeLiabilities(): void
|
||||
|
||||
@@ -64,11 +64,8 @@ class UpgradesLiabilitiesEight extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function upgradeLiabilities(): void
|
||||
|
||||
@@ -65,11 +65,8 @@ class UpgradesMultiPiggyBanks extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function upgradePiggyBanks(): void
|
||||
|
||||
@@ -61,11 +61,8 @@ class UpgradesPrimaryCurrencyAmounts extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function markAsExecuted(): void
|
||||
|
||||
@@ -66,11 +66,8 @@ class UpgradesRecurrenceMetaData extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function migrateMetaData(): int
|
||||
|
||||
@@ -64,11 +64,8 @@ class UpgradesRuleActions extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function replaceEqualSign(): void
|
||||
|
||||
@@ -58,11 +58,8 @@ class UpgradesTagLocations extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function migrateTagLocations(): void
|
||||
|
||||
@@ -98,11 +98,8 @@ class UpgradesToGroups extends Command
|
||||
private function isMigrated(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,11 +106,8 @@ class UpgradesTransferCurrencies extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,11 +87,8 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool) $configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,11 +64,8 @@ class UpgradesWebhooks extends Command
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
if (null !== $configVar) {
|
||||
return (bool)$configVar->data;
|
||||
}
|
||||
return (bool)$configVar?->data;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function upgradeWebhooks(): void
|
||||
|
||||
Reference in New Issue
Block a user