Code cleanup

This commit is contained in:
James Cole
2018-04-28 06:23:13 +02:00
parent 6f0e1c79ac
commit 13b78bdc20
218 changed files with 621 additions and 681 deletions

View File

@@ -89,9 +89,9 @@ class CreateExport extends Command
$accountRepository->setUser($user);
// first date
$firstJournal = $journalRepository->first();
$firstJournal = $journalRepository->firstNull();
$first = new Carbon;
if (null !== $firstJournal->id) {
if (null !== $firstJournal) {
$first = $firstJournal->date;
}

View File

@@ -100,6 +100,5 @@ class DecryptAttachment extends Command
}
$this->info(sprintf('%d bytes written. Exiting now..', $result));
return;
}
}

View File

@@ -93,7 +93,6 @@ class Import extends Command
sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines())
);
return;
}
/**

View File

@@ -106,7 +106,7 @@ class UpgradeDatabase extends Command
if ($ruleGroup === null) {
$array = RuleGroup::get(['order'])->pluck('order')->toArray();
$order = count($array) > 0 ? max($array) + 1 : 1;
$order = \count($array) > 0 ? max($array) + 1 : 1;
$ruleGroup = RuleGroup::create(
[
'user_id' => $user->id,
@@ -240,7 +240,6 @@ class UpgradeDatabase extends Command
$this->updateJournalidentifiers((int)$journalId);
}
return;
}
/**
@@ -294,7 +293,6 @@ class UpgradeDatabase extends Command
}
);
return;
}
/**
@@ -352,7 +350,6 @@ class UpgradeDatabase extends Command
}
);
return;
}
/**
@@ -413,7 +410,7 @@ class UpgradeDatabase extends Command
// move description:
$description = (string)$att->description;
if (strlen($description) > 0) {
if (\strlen($description) > 0) {
// find or create note:
$note = $att->notes()->first();
if (null === $note) {
@@ -484,7 +481,6 @@ class UpgradeDatabase extends Command
$journal->save();
}
return;
}
/**
@@ -530,7 +526,6 @@ class UpgradeDatabase extends Command
++$identifier;
}
return;
}
/**
@@ -663,7 +658,6 @@ class UpgradeDatabase extends Command
$opposing->save();
}
return;
}
}

View File

@@ -92,7 +92,7 @@ class UpgradeFireflyInstructions extends Command
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
$len = \strlen($compare);
if (substr($version, 0, $len) === $compare) {
$text = $config[$compare];
}
@@ -139,7 +139,7 @@ class UpgradeFireflyInstructions extends Command
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
$len = \strlen($compare);
if (substr($version, 0, $len) === $compare) {
$text = $config[$compare];
}