Various code cleanup.

This commit is contained in:
James Cole
2025-10-05 12:57:58 +02:00
parent 072212c112
commit 6341743cf9
169 changed files with 482 additions and 305 deletions

View File

@@ -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;
}
/**

View File

@@ -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

View File

@@ -100,7 +100,6 @@ class UpgradesAccountCurrencies extends Command
}
/**
* @throws FireflyException
*/
private function updateCurrenciesForUser(User $user): void
{

View File

@@ -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

View File

@@ -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

View File

@@ -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
{

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
/**

View File

@@ -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;
}
/**

View File

@@ -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;
}
/**

View File

@@ -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