Code cleanup.

This commit is contained in:
James Cole
2021-03-28 11:43:07 +02:00
parent 5abbb8a807
commit 2c575f3ca5
379 changed files with 304 additions and 1727 deletions

View File

@@ -59,7 +59,6 @@ class AccountCurrencies extends Command
/** @var UserRepositoryInterface */
private $userRepos;
/**
* Each (asset) account must have a reference to a preferred currency. If the account does not have one, it's forced upon the account.
*
@@ -88,7 +87,6 @@ class AccountCurrencies extends Command
$this->info(sprintf('Verified and fixed account currencies in %s seconds.', $end));
$this->markAsExecuted();
return 0;
}
@@ -206,8 +204,6 @@ class AccountCurrencies extends Command
return;
}
// do not match and opening balance id is not null.
if ($accountCurrency !== $obCurrency && null !== $openingBalance) {
Log::debug(sprintf('Account (#%d) and OB currency (#%d) are different. Overrule OB, set to account currency.', $accountCurrency, $obCurrency));

View File

@@ -1,5 +1,4 @@
<?php
/*
* AppendBudgetLimitPeriods.php
* Copyright (c) 2021 james@firefly-iii.org
@@ -21,25 +20,6 @@
*/
declare(strict_types=1);
/*
* AppendBudgetLimitPeriods.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Console\Commands\Upgrade;

View File

@@ -51,7 +51,6 @@ class BackToJournals extends Command
*/
protected $signature = 'firefly-iii:back-to-journals {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Console\Command;
@@ -47,7 +46,6 @@ class BudgetLimitCurrency extends Command
*/
protected $signature = 'firefly-iii:bl-currency {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -109,7 +107,6 @@ class BudgetLimitCurrency extends Command
return false; // @codeCoverageIgnore
}
/**
*
*/

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use Illuminate\Console\Command;
@@ -34,8 +33,6 @@ use Illuminate\Support\Collection;
*/
class CCLiabilities extends Command
{
public const CONFIG_NAME = '480_cc_liabilities';
/**
* The console command description.
@@ -50,7 +47,6 @@ class CCLiabilities extends Command
*/
protected $signature = 'firefly-iii:cc-liabilities {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -108,7 +104,6 @@ class CCLiabilities extends Command
return false; // @codeCoverageIgnore
}
/**
*
*/

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\Note;
use Illuminate\Console\Command;
@@ -48,7 +47,6 @@ class MigrateAttachments extends Command
*/
protected $signature = 'firefly-iii:migrate-attachments {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -118,7 +116,6 @@ class MigrateAttachments extends Command
return false; // @codeCoverageIgnore
}
/**
*
*/

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use Exception;
use FireflyIII\Models\Note;
use FireflyIII\Models\TransactionJournalMeta;
@@ -49,7 +48,6 @@ class MigrateJournalNotes extends Command
*/
protected $signature = 'firefly-iii:migrate-notes {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -117,7 +115,6 @@ class MigrateJournalNotes extends Command
return false; // @codeCoverageIgnore
}
/**
*
*/

View File

@@ -47,7 +47,6 @@ class MigrateRecurrenceMeta extends Command
*/
protected $signature = 'firefly-iii:migrate-recurrence-meta {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*

View File

@@ -1,5 +1,27 @@
<?php
/*
* MigrateRecurrenceType.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Models\Recurrence;

View File

@@ -48,7 +48,6 @@ class MigrateTagLocations extends Command
*/
protected $signature = 'firefly-iii:migrate-tag-locations {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -130,6 +129,4 @@ class MigrateTagLocations extends Command
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);
}
}

View File

@@ -104,8 +104,6 @@ class MigrateToGroups extends Command
if (0 === $this->count) {
$this->line('No journals to migrate to groups.');
}
$this->markAsMigrated();
return 0;

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Preference;
@@ -63,7 +62,6 @@ class MigrateToRules extends Command
/** @var UserRepositoryInterface */
private $userRepository;
/**
* Execute the console command.
*

View File

@@ -66,7 +66,6 @@ class OtherCurrenciesCorrections extends Command
/** @var JournalRepositoryInterface */
private $journalRepos;
/**
* Execute the console command.
*

View File

@@ -45,7 +45,6 @@ class RenameAccountMeta extends Command
*/
protected $signature = 'firefly-iii:rename-account-meta {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
*
@@ -108,7 +107,6 @@ class RenameAccountMeta extends Command
return false; // @codeCoverageIgnore
}
/**
*
*/

View File

@@ -57,7 +57,6 @@ class TransactionIdentifier extends Command
/** @var JournalRepositoryInterface */
private $journalRepository;
/**
* This method gives all transactions which are part of a split journal (so more than 2) a sort of "order" so they are easier
* to easier to match to their counterpart. When a journal is split, it has two or three transactions: -3, -4 and -5 for example.

View File

@@ -70,8 +70,6 @@ class TransferCurrenciesCorrections extends Command
*/
public function handle(): int
{
$this->stupidLaravel();
$start = microtime(true);
// @codeCoverageIgnoreStart
@@ -188,8 +186,6 @@ class TransferCurrenciesCorrections extends Command
return;
}
// @codeCoverageIgnoreEnd
// both accounts must have currency preference:
// @codeCoverageIgnoreStart
if ($this->isNoCurrencyPresent()) {

View File

@@ -48,7 +48,6 @@ class UpgradeDatabase extends Command
*/
protected $signature = 'firefly-iii:upgrade-database {--F|force : Force all upgrades.}';
/**
* Execute the console command.
*
@@ -58,8 +57,6 @@ class UpgradeDatabase extends Command
{
$this->callInitialCommands();
$commands = [
// there are 14 upgrade commands.
'firefly-iii:transaction-identifiers',