Add some comments [skip ci]

This commit is contained in:
James Cole
2017-08-15 17:26:43 +02:00
parent 1633994fbd
commit 34894fb76b
6 changed files with 29 additions and 11 deletions

View File

@@ -54,6 +54,8 @@ class CreateImport extends Command
} }
/** /**
* Run the command.
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
*/ */
@@ -133,6 +135,8 @@ class CreateImport extends Command
} }
/** /**
* Verify user inserts correct arguments.
*
* @return bool * @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
*/ */

View File

@@ -51,7 +51,7 @@ class Import extends Command
} }
/** /**
* * Run the import routine.
*/ */
public function handle() public function handle()
{ {
@@ -91,6 +91,8 @@ class Import extends Command
} }
/** /**
* Check if job is valid to be imported.
*
* @param ImportJob $job * @param ImportJob $job
* *
* @return bool * @return bool

View File

@@ -26,15 +26,14 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType; use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Database\QueryException; use Illuminate\Database\QueryException;
use Log; use Log;
use Preferences; use Preferences;
use Schema; use Schema;
use Steam;
/** /**
* Class UpgradeDatabase * Class UpgradeDatabase
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it just touches a lot of things. * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it just touches a lot of things.
* *
* @package FireflyIII\Console\Commands * @package FireflyIII\Console\Commands
@@ -74,8 +73,8 @@ class UpgradeDatabase extends Command
$this->updateTransferCurrencies(); $this->updateTransferCurrencies();
$this->updateOtherCurrencies(); $this->updateOtherCurrencies();
$this->info('Firefly III database is up to date.'); $this->info('Firefly III database is up to date.');
return;
return;
} }
@@ -136,8 +135,7 @@ class UpgradeDatabase extends Command
} }
/** /**
* Each (asset) account must have a reference to a preferred currency. If the account does not have one, it's forced upon * Each (asset) account must have a reference to a preferred currency. If the account does not have one, it's forced upon the account.
* the account.
*/ */
public function updateAccountCurrencies(): void public function updateAccountCurrencies(): void
{ {
@@ -193,7 +191,7 @@ class UpgradeDatabase extends Command
* Both source and destination must match the respective currency preference of the related asset account. * Both source and destination must match the respective currency preference of the related asset account.
* So FF3 must verify all transactions. * So FF3 must verify all transactions.
*/ */
public function updateOtherCurrencies() public function updateOtherCurrencies(): void
{ {
/** @var CurrencyRepositoryInterface $repository */ /** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class); $repository = app(CurrencyRepositoryInterface::class);
@@ -241,6 +239,7 @@ class UpgradeDatabase extends Command
$journal->save(); $journal->save();
} }
); );
return; return;
} }

View File

@@ -84,6 +84,9 @@ class UpgradeFireflyInstructions extends Command
} }
} }
/**
* Render instructions.
*/
private function installInstructions() private function installInstructions()
{ {
/** @var string $version */ /** @var string $version */
@@ -102,7 +105,7 @@ class UpgradeFireflyInstructions extends Command
$this->boxed(''); $this->boxed('');
if (is_null($text)) { if (is_null($text)) {
$this->boxed(sprintf('Thank you for installin Firefly III, v%s!', $version)); $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version));
$this->boxedInfo('There are no extra installation instructions.'); $this->boxedInfo('There are no extra installation instructions.');
$this->boxed('Firefly III should be ready for use.'); $this->boxed('Firefly III should be ready for use.');
$this->boxed(''); $this->boxed('');
@@ -131,6 +134,9 @@ class UpgradeFireflyInstructions extends Command
} }
/**
* Render upgrade instructions.
*/
private function updateInstructions() private function updateInstructions()
{ {
/** @var string $version */ /** @var string $version */

View File

@@ -16,6 +16,8 @@ use Illuminate\Support\Str;
/** /**
* Class UseEncryption * Class UseEncryption
*
* @package FireflyIII\Console\Commands
*/ */
class UseEncryption extends Command class UseEncryption extends Command
{ {
@@ -46,7 +48,6 @@ class UseEncryption extends Command
*/ */
public function handle() public function handle()
{ {
//
$this->handleObjects('Account', 'name', 'encrypted'); $this->handleObjects('Account', 'name', 'encrypted');
$this->handleObjects('Bill', 'name', 'name_encrypted'); $this->handleObjects('Bill', 'name', 'name_encrypted');
$this->handleObjects('Bill', 'match', 'match_encrypted'); $this->handleObjects('Bill', 'match', 'match_encrypted');
@@ -57,6 +58,8 @@ class UseEncryption extends Command
} }
/** /**
* Run each object and encrypt them (or not).
*
* @param string $class * @param string $class
* @param string $field * @param string $field
* @param string $indicator * @param string $indicator

View File

@@ -204,6 +204,9 @@ class VerifyDatabase extends Command
} }
} }
/**
* Report on journals with bad account types linked to them.
*/
private function reportIncorrectJournals() private function reportIncorrectJournals()
{ {
$configuration = [ $configuration = [
@@ -270,7 +273,7 @@ class VerifyDatabase extends Command
} }
/** /**
* * Report on journals without transactions.
*/ */
private function reportNoTransactions() private function reportNoTransactions()
{ {
@@ -288,6 +291,7 @@ class VerifyDatabase extends Command
} }
/** /**
* Report on things with no linked journals.
* @param string $name * @param string $name
*/ */
private function reportObject(string $name) private function reportObject(string $name)
@@ -359,7 +363,7 @@ class VerifyDatabase extends Command
} }
/** /**
* * Report on transfers that have budgets.
*/ */
private function reportTransfersBudgets() private function reportTransfersBudgets()
{ {