Skip to content

Firefly III: a personal finances manager

Some cleaning up.

James Cole8e6ca0dd0549
diff --git a/app/commands/Cleanup.php b/app/commands/Cleanup.php
index 2e5c889068..7f87a18a1c 100644
--- a/app/commands/Cleanup.php
+++ b/app/commands/Cleanup.php
@@ -4,6 +4,9 @@ use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
+/**
+ * Class Cleanup
+ */
class Cleanup extends Command
{
@@ -21,9 +24,7 @@ class Cleanup extends Command
protected $name = 'firefly:cleanup';
/**
- * Create a new command instance.
*
- * @return void
*/
public function __construct()
{
diff --git a/app/lib/FireflyIII/Event/Piggybank.php b/app/lib/FireflyIII/Event/Piggybank.php
index c24110cf98..cadb6dadd2 100644
--- a/app/lib/FireflyIII/Event/Piggybank.php
+++ b/app/lib/FireflyIII/Event/Piggybank.php
@@ -219,7 +219,7 @@ class Piggybank
*/
public function validateRepeatedExpenses()
{
- if(!\Auth::check()) {
+ if (!\Auth::check()) {
return;
}
/** @var \FireflyIII\Database\PiggyBank\RepeatedExpense $repository */
diff --git a/app/lib/FireflyIII/Event/Transaction.php b/app/lib/FireflyIII/Event/Transaction.php
index e5d53e04f5..2b58b3c97e 100644
--- a/app/lib/FireflyIII/Event/Transaction.php
+++ b/app/lib/FireflyIII/Event/Transaction.php
@@ -19,6 +19,9 @@ class Transaction
{
\Cache::forget('account.' . $transaction->account_id . '.latestBalance');
\Cache::forget('account.' . $transaction->account_id . '.lastActivityDate');
+
+ // delete transaction:
+ $transaction->delete();
}
/**
diff --git a/app/lib/FireflyIII/Event/TransactionJournal.php b/app/lib/FireflyIII/Event/TransactionJournal.php
index 72755edef8..ed62684c96 100644
--- a/app/lib/FireflyIII/Event/TransactionJournal.php
+++ b/app/lib/FireflyIII/Event/TransactionJournal.php
@@ -14,7 +14,6 @@ class TransactionJournal
/**
* @param \TransactionJournal $journal
- * @param int $id
*/
public function store(\TransactionJournal $journal)
{
diff --git a/app/lib/FireflyIII/Shared/Toolkit/Date.php b/app/lib/FireflyIII/Shared/Toolkit/Date.php
index c34f320e5a..c655a9afb8 100644
--- a/app/lib/FireflyIII/Shared/Toolkit/Date.php
+++ b/app/lib/FireflyIII/Shared/Toolkit/Date.php
@@ -130,7 +130,7 @@ class Date
case 'half-year':
$month = intval($theCurrentEnd->format('m'));
$currentEnd->endOfYear();
- if($month <= 6) {
+ if ($month <= 6) {
$currentEnd->subMonths(6);
}
break;
diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php
index c0d01d3355..e3ce3bcc0d 100644
--- a/app/tests/TestCase.php
+++ b/app/tests/TestCase.php
@@ -29,6 +29,11 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
//$this->
}
+ /**
+ * @param $class
+ *
+ * @return m\MockInterface
+ */
public function mock($class)
{
$mock = Mockery::mock($class);
diff --git a/bootstrap/start.php b/bootstrap/start.php
index 8ae272f09c..34375137b7 100644
--- a/bootstrap/start.php
+++ b/bootstrap/start.php
@@ -1,6 +1,12 @@
<?php
if (!function_exists('mf')) {
+ /**
+ * @param $n
+ * @param bool $coloured
+ *
+ * @return string
+ */
function mf($n, $coloured = true)
{