Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Cleaning up
James Colebeedf7d7807e
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.phpindex 07e2bb7ece..6f8232dbc0 100644--- a/app/Console/Kernel.php+++ b/app/Console/Kernel.php@@ -26,6 +26,8 @@ class Kernel extends ConsoleKernel** @param \Illuminate\Console\Scheduling\Schedule $schedule*+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)+ ** @return void*/protected function schedule(Schedule $schedule)diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex 5bf9d44d91..08c263fb3a 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -27,6 +27,7 @@ class Handler extends ExceptionHandler** @param \Illuminate\Http\Request $request* @param \Exception $e+ * @SuppressWarnings(PHPMD.ShortVariable)** @return \Illuminate\Http\Response*/diff --git a/app/Handlers/Events/JournalDeletedHandler.php b/app/Handlers/Events/JournalDeletedHandler.phpdeleted file mode 100644index 757738ba62..0000000000--- a/app/Handlers/Events/JournalDeletedHandler.php+++ /dev/null@@ -1,36 +0,0 @@-<?php namespace FireflyIII\Handlers\Events;--use FireflyIII\Events\JournalDeleted;--/**- * Class JournalDeletedHandler- *- * @codeCoverageIgnore- * @package FireflyIII\Handlers\Events- */-class JournalDeletedHandler-{-- /**- * Create the event handler.- *- */- public function __construct()- {- //- }-- /**- * Handle the event.- *- * @param JournalDeleted $event- *- * @return void- */- public function handle(JournalDeleted $event)- {- //-- }--}diff --git a/app/Helpers/Reminders/ReminderHelper.php b/app/Helpers/Reminders/ReminderHelper.phpindex cdf0478ada..e17c81281d 100644--- a/app/Helpers/Reminders/ReminderHelper.php+++ b/app/Helpers/Reminders/ReminderHelper.php@@ -68,6 +68,8 @@ class ReminderHelper implements ReminderHelperInterface** @param PiggyBank $piggyBank*+ * @param Carbon $date+ ** @return mixed*/public function createReminders(PiggyBank $piggyBank, Carbon $date)diff --git a/app/Helpers/Reminders/ReminderHelperInterface.php b/app/Helpers/Reminders/ReminderHelperInterface.phpindex 18c65b2e47..46ea7fd510 100644--- a/app/Helpers/Reminders/ReminderHelperInterface.php+++ b/app/Helpers/Reminders/ReminderHelperInterface.php@@ -56,6 +56,8 @@ interface ReminderHelperInterface** @param PiggyBank $piggyBank*+ * @param Carbon $date+ ** @return mixed*/public function createReminders(PiggyBank $piggyBank, Carbon $date);diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.phpindex c0784a87a9..8c6440e6b3 100644--- a/app/Helpers/Report/ReportHelper.php+++ b/app/Helpers/Report/ReportHelper.php@@ -32,7 +32,6 @@ class ReportHelper implements ReportHelperInterface/*** @param ReportQueryInterface $query*- * @internal param ReportHelperInterface $helper*/public function __construct(ReportQueryInterface $query){diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.phpindex a3e5128b7f..ab4ad796b3 100644--- a/app/Repositories/PiggyBank/PiggyBankRepository.php+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php@@ -19,57 +19,6 @@ use Navigation;class PiggyBankRepository implements PiggyBankRepositoryInterface{-- /**- *- * Based on the piggy bank, the reminder-setting and- * other variables this method tries to divide the piggy bank into equal parts. Each is- * accommodated by a reminder (if everything goes to plan).- *- * @param PiggyBankRepetition $repetition- *- * @return Collection- */- public function calculateParts(PiggyBankRepetition $repetition)- {- /** @var PiggyBank $piggyBank */- $piggyBank = $repetition->piggyBank()->first();- $bars = new Collection;- $currentStart = clone $repetition->startdate;-- if (is_null($piggyBank->reminder)) {- $entry = ['repetition' => $repetition, 'amountPerBar' => floatval($piggyBank->targetamount),- 'currentAmount' => floatval($repetition->currentamount), 'cumulativeAmount' => floatval($piggyBank->targetamount),- 'startDate' => clone $repetition->startdate, 'targetDate' => clone $repetition->targetdate];- $bars->push($this->createPiggyBankPart($entry));-- return $bars;- }-- while ($currentStart < $repetition->targetdate) {- $currentTarget = Navigation::endOfX($currentStart, $piggyBank->reminder, $repetition->targetdate);- $entry = ['repetition' => $repetition, 'amountPerBar' => null, 'currentAmount' => floatval($repetition->currentamount),- 'cumulativeAmount' => null, 'startDate' => $currentStart, 'targetDate' => $currentTarget];- $bars->push($this->createPiggyBankPart($entry));- $currentStart = clone $currentTarget;- $currentStart->addDay();-- }- $amountPerBar = floatval($piggyBank->targetamount) / $bars->count();- $cumulative = $amountPerBar;- /** @var PiggyBankPart $bar */- foreach ($bars as $index => $bar) {- $bar->setAmountPerBar($amountPerBar);- $bar->setCumulativeAmount($cumulative);- if ($bars->count() - 1 == $index) {- $bar->setCumulativeAmount($piggyBank->targetamount);- }- $cumulative += $amountPerBar;- }-- return $bars;- }-/*** @param PiggyBank $piggyBank* @param $amount@@ -83,24 +32,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterfacereturn true;}- /**- * @param array $data- *- * @return PiggyBankPart- */- public function createPiggyBankPart(array $data)- {- $part = new PiggyBankPart;- $part->setRepetition($data['repetition']);- $part->setAmountPerBar($data['amountPerBar']);- $part->setCurrentamount($data['currentAmount']);- $part->setCumulativeAmount($data['cumulativeAmount']);- $part->setStartdate($data['startDate']);- $part->setTargetdate($data['targetDate']);-- return $part;- }-/*** @param PiggyBank $piggyBank*diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.phpindex ce67a6b6b0..7724a294a8 100644--- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php+++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php@@ -14,18 +14,6 @@ use Illuminate\Support\Collection;interface PiggyBankRepositoryInterface{- /**- *- * Based on the piggy bank, the reminder-setting and- * other variables this method tries to divide the piggy bank into equal parts. Each is- * accommodated by a reminder (if everything goes to plan).- *- * @param PiggyBankRepetition $repetition- *- * @return Collection- */- public function calculateParts(PiggyBankRepetition $repetition);-/*** @return Collection*/@@ -38,13 +26,6 @@ interface PiggyBankRepositoryInterface*/public function getEvents(PiggyBank $piggyBank);- /**- * @param array $data- *- * @return PiggyBankPart- */- public function createPiggyBankPart(array $data);-/*** @param PiggyBank $piggyBank* @param $amountdiff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.phpindex 188853939b..c8e172e68d 100644--- a/app/Repositories/Tag/TagRepository.php+++ b/app/Repositories/Tag/TagRepository.php@@ -18,6 +18,8 @@ class TagRepository implements TagRepositoryInterface{/**+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.+ ** @param TransactionJournal $journal* @param Tag $tag*diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.phpindex c28c7ea5b8..9263fd13d4 100644--- a/app/Validation/FireflyValidator.php+++ b/app/Validation/FireflyValidator.php@@ -29,10 +29,11 @@ class FireflyValidator extends Validator* @param array $rules* @param array $messages* @param array $customAttributes+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)*/public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = []){- parent::__construct($translator, $data, $rules, $messages);+ parent::__construct($translator, $data, $rules, $messages, $customAttributes);}/**