Skip to content

Firefly III: a personal finances manager

General cleanup.

James Cole4a5117619383
diff --git a/app/Events/JournalCreated.php b/app/Events/JournalCreated.php
index 0fc11fb491..65c8929d4b 100644
--- a/app/Events/JournalCreated.php
+++ b/app/Events/JournalCreated.php
@@ -19,7 +19,8 @@ class JournalCreated extends Event
/**
* Create a new event instance.
*
- * @return void
+ * @param TransactionJournal $journal
+ * @param $piggyBankId
*/
public function __construct(TransactionJournal $journal, $piggyBankId)
{
diff --git a/app/Events/JournalDeleted.php b/app/Events/JournalDeleted.php
index d19937a9cd..eadf06bb81 100644
--- a/app/Events/JournalDeleted.php
+++ b/app/Events/JournalDeleted.php
@@ -2,6 +2,11 @@
use Illuminate\Queue\SerializesModels;
+/**
+ * Class JournalDeleted
+ *
+ * @package FireflyIII\Events
+ */
class JournalDeleted extends Event
{
@@ -10,7 +15,6 @@ class JournalDeleted extends Event
/**
* Create a new event instance.
*
- * @return void
*/
public function __construct()
{
diff --git a/app/Events/JournalSaved.php b/app/Events/JournalSaved.php
index 25471ca809..e3a8a37da0 100644
--- a/app/Events/JournalSaved.php
+++ b/app/Events/JournalSaved.php
@@ -3,6 +3,11 @@
use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels;
+/**
+ * Class JournalSaved
+ *
+ * @package FireflyIII\Events
+ */
class JournalSaved extends Event
{
@@ -13,7 +18,7 @@ class JournalSaved extends Event
/**
* Create a new event instance.
*
- * @return void
+ * @param TransactionJournal $journal
*/
public function __construct(TransactionJournal $journal)
{
diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php
index f7bf4a7690..c7e77a5d2d 100644
--- a/app/Helpers/Help/Help.php
+++ b/app/Helpers/Help/Help.php
@@ -54,7 +54,9 @@ class Help implements HelpInterface
}
/**
- * @return boolean
+ * @param $route
+ *
+ * @return bool
*/
public function hasRoute($route)
{
@@ -62,10 +64,10 @@ class Help implements HelpInterface
}
/**
- * @param $title
+ * @param $route
* @param array $content
*
- * @return void
+ * @internal param $title
*/
public function putInCache($route, array $content)
{
diff --git a/app/Helpers/Help/HelpInterface.php b/app/Helpers/Help/HelpInterface.php
index c550a9faf5..b11e29b4ab 100644
--- a/app/Helpers/Help/HelpInterface.php
+++ b/app/Helpers/Help/HelpInterface.php
@@ -17,11 +17,6 @@ interface HelpInterface
*/
public function getFromCache($key);
- /**
- * @return boolean
- */
- public function hasRoute($route);
-
/**
* @param $route
*
@@ -30,12 +25,11 @@ interface HelpInterface
public function getFromGithub($route);
/**
- * @param $route
- * @param array $content
+ * @param $route
*
- * @return void
+ * @return bool
*/
- public function putInCache($route, array $content);
+ public function hasRoute($route);
/**
* @param $route
@@ -43,4 +37,12 @@ interface HelpInterface
* @return bool
*/
public function inCache($route);
+
+ /**
+ * @param $route
+ * @param array $content
+ *
+ * @return void
+ */
+ public function putInCache($route, array $content);
}
\ No newline at end of file
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index 2eb8b8f47b..74a9966476 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -92,7 +92,7 @@ class AccountController extends Controller
*
* @return View
*/
- public function edit(AccountRepositoryInterface $repository,Account $account)
+ public function edit(AccountRepositoryInterface $repository, Account $account)
{
$what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type];
diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php
index ee1e8cdceb..cacd05d40c 100644
--- a/app/Http/Controllers/BudgetController.php
+++ b/app/Http/Controllers/BudgetController.php
@@ -264,10 +264,10 @@ class BudgetController extends Controller
*/
public function updateIncome()
{
- $date = Session::get('start', Carbon::now()->startOfMonth())->format('FY');
+ $date = Session::get('start', Carbon::now()->startOfMonth())->format('FY');
$amount = Preferences::get('budgetIncomeTotal' . $date, 1000);
- return view('budgets.income',compact('amount'));
+ return view('budgets.income', compact('amount'));
}
}
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php
index ab5983980b..2dfd42cff4 100644
--- a/app/Http/Controllers/CategoryController.php
+++ b/app/Http/Controllers/CategoryController.php
@@ -97,8 +97,9 @@ class CategoryController extends Controller
}
/**
- * @return $this
+ * @param CategoryRepositoryInterface $repository
*
+ * @return $this
*/
public function index(CategoryRepositoryInterface $repository)
{
@@ -114,6 +115,8 @@ class CategoryController extends Controller
}
/**
+ * @param CategoryRepositoryInterface $repository
+ *
* @return \Illuminate\View\View
*/
public function noCategory(CategoryRepositoryInterface $repository)
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index ec8863c481..79eb406cf9 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -133,6 +133,8 @@ class CurrencyController extends Controller
}
/**
+ * @param CurrencyRepositoryInterface $repository
+ *
* @return \Illuminate\View\View
*/
public function index(CurrencyRepositoryInterface $repository)
@@ -146,6 +148,9 @@ class CurrencyController extends Controller
/**
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
*
+ * @param CurrencyFormRequest $request
+ * @param CurrencyRepositoryInterface $repository
+ *
* @return $this|\Illuminate\Http\RedirectResponse
*/
public function store(CurrencyFormRequest $request, CurrencyRepositoryInterface $repository)
diff --git a/app/Http/Controllers/GoogleChartController.php b/app/Http/Controllers/GoogleChartController.php
index c7751d889d..21b569de47 100644
--- a/app/Http/Controllers/GoogleChartController.php
+++ b/app/Http/Controllers/GoogleChartController.php
@@ -243,7 +243,10 @@ class GoogleChartController extends Controller
}
/**
- * @param GChart $chart
+ * @param GChart $chart
+ *
+ * @param BillRepositoryInterface $repository
+ * @param AccountRepositoryInterface $accounts
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@@ -494,7 +497,7 @@ class GoogleChartController extends Controller
*
* @return \Symfony\Component\HttpFoundation\Response
*/
- public function yearInExp(GChart $chart, ReportQueryInterface $query,$year)
+ public function yearInExp(GChart $chart, ReportQueryInterface $query, $year)
{
$start = new Carbon('01-01-' . $year);
$chart->addColumn('Month', 'date');
diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php
index a1562e79cb..7220742700 100644
--- a/app/Http/Controllers/HelpController.php
+++ b/app/Http/Controllers/HelpController.php
@@ -13,7 +13,8 @@ class HelpController extends Controller
{
/**
- * @param $route
+ * @param HelpInterface $help
+ * @param $route
*
* @return \Illuminate\Http\JsonResponse
*/
diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php
index 08ac171b3b..db13db45d7 100644
--- a/app/Http/Controllers/JsonController.php
+++ b/app/Http/Controllers/JsonController.php
@@ -28,7 +28,9 @@ class JsonController extends Controller
/**
- * @param BillRepositoryInterface $repository
+ * @param BillRepositoryInterface $repository
+ *
+ * @param AccountRepositoryInterface $accountRepository
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@@ -149,6 +151,8 @@ class JsonController extends Controller
/**
* Returns a list of categories.
*
+ * @param CategoryRepositoryInterface $repository
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function categories(CategoryRepositoryInterface $repository)
@@ -166,6 +170,8 @@ class JsonController extends Controller
/**
* Returns a JSON list of all beneficiaries.
*
+ * @param AccountRepositoryInterface $accountRepository
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function expenseAccounts(AccountRepositoryInterface $accountRepository)
@@ -183,6 +189,8 @@ class JsonController extends Controller
/**
* Returns a JSON list of all beneficiaries.
*
+ * @param TagRepositoryInterface $tagRepository
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function tags(TagRepositoryInterface $tagRepository)
@@ -198,6 +206,8 @@ class JsonController extends Controller
}
/**
+ * @param AccountRepositoryInterface $accountRepository
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function revenueAccounts(AccountRepositoryInterface $accountRepository)
diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php
index 6acb521341..f0e8543b5b 100644
--- a/app/Http/Controllers/PiggyBankController.php
+++ b/app/Http/Controllers/PiggyBankController.php
@@ -40,7 +40,8 @@ class PiggyBankController extends Controller
/**
* Add money to piggy bank
*
- * @param PiggyBank $piggyBank
+ * @param AccountRepositoryInterface $repository
+ * @param PiggyBank $piggyBank
*
* @return $this
*/
@@ -55,6 +56,8 @@ class PiggyBankController extends Controller
}
/**
+ * @param AccountRepositoryInterface $repository
+ *
* @return mixed
*/
public function create(AccountRepositoryInterface $repository)
@@ -337,10 +340,11 @@ class PiggyBankController extends Controller
}
/**
- * @param PiggyBank $piggyBank
+ * @param PiggyBankRepositoryInterface $repository
+ * @param PiggyBankFormRequest $request
+ * @param PiggyBank $piggyBank
*
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
- *
* @return $this
*/
public function update(PiggyBankRepositoryInterface $repository, PiggyBankFormRequest $request, PiggyBank $piggyBank)
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index 84d2901104..0097b4a9cf 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -26,6 +26,8 @@ class PreferencesController extends Controller
}
/**
+ * @param AccountRepositoryInterface $repository
+ *
* @return $this|\Illuminate\View\View
*/
public function index(AccountRepositoryInterface $repository)
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index 98154d6be7..c13f57894b 100644
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -46,6 +46,8 @@ class ProfileController extends Controller
}
/**
+ * @param ProfileFormRequest $request
+ *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function postChangePassword(ProfileFormRequest $request)
@@ -91,7 +93,10 @@ class ProfileController extends Controller
}
/**
+ * @param DeleteAccountFormRequest $request
*
+ * @return \Illuminate\Http\RedirectResponse
+ * @throws \Exception
*/
public function postDeleteAccount(DeleteAccountFormRequest $request)
{
diff --git a/app/Http/Controllers/ReminderController.php b/app/Http/Controllers/ReminderController.php
index a5e0b087db..9e80c5acd0 100644
--- a/app/Http/Controllers/ReminderController.php
+++ b/app/Http/Controllers/ReminderController.php
@@ -1,7 +1,5 @@
<?php namespace FireflyIII\Http\Controllers;
-use Auth;
-use FireflyIII\Helpers\Reminders\ReminderHelperInterface;
use FireflyIII\Models\Reminder;
use FireflyIII\Repositories\Reminder\ReminderRepositoryInterface;
use Redirect;
@@ -19,6 +17,8 @@ class ReminderController extends Controller
/**
* @param Reminder $reminder
+ *
+ * @return \Illuminate\Http\RedirectResponse
*/
public function act(Reminder $reminder)
{
@@ -36,6 +36,8 @@ class ReminderController extends Controller
/**
* @param Reminder $reminder
+ *
+ * @return \Illuminate\Http\RedirectResponse
*/
public function dismiss(Reminder $reminder)
{
@@ -48,7 +50,9 @@ class ReminderController extends Controller
}
/**
+ * @param ReminderRepositoryInterface $repository
*
+ * @return \Illuminate\View\View
*/
public function index(ReminderRepositoryInterface $repository)
{
@@ -67,6 +71,8 @@ class ReminderController extends Controller
/**
* @param Reminder $reminder
+ *
+ * @return \Illuminate\View\View
*/
public function show(Reminder $reminder)
{
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index e75260a864..5e9c43e253 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -1,7 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Carbon\Carbon;
-use Exception;
use FireflyIII\Helpers\Report\ReportHelperInterface;
use FireflyIII\Helpers\Report\ReportQueryInterface;
use FireflyIII\Models\Account;
@@ -107,9 +106,9 @@ class ReportController extends Controller
}
/**
- * @param ReportHelperInterface $helper
- *
* @return View
+ * @internal param ReportHelperInterface $helper
+ *
*/
public function index()
{
@@ -144,12 +143,13 @@ class ReportController extends Controller
}
/**
- * @param Account $account
- * @param string $year
- * @param string $month
- * @param ReportQueryInterface $query
+ * @param Account $account
+ * @param string $year
+ * @param string $month
*
* @return View
+ * @internal param ReportQueryInterface $query
+ *
*/
public function modalLeftUnbalanced(Account $account, $year = '2014', $month = '1')
{
@@ -164,6 +164,8 @@ class ReportController extends Controller
if ($count == 0) {
return $journal;
}
+
+ return null;
}
);
diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php
index 4a6016fadd..09b8527c37 100644
--- a/app/Http/Controllers/SearchController.php
+++ b/app/Http/Controllers/SearchController.php
@@ -12,6 +12,10 @@ class SearchController extends Controller
{
/**
* Results always come in the form of an array [results, count, fullCount]
+ *
+ * @param SearchInterface $searcher
+ *
+ * @return $this
*/
public function index(SearchInterface $searcher)
{
diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php
index cf59e21d95..5d54937c4e 100644
--- a/app/Http/Controllers/TagController.php
+++ b/app/Http/Controllers/TagController.php
@@ -92,7 +92,7 @@ class TagController extends Controller
*
* @return \Illuminate\Http\RedirectResponse
*/
- public function destroy(TagRepositoryInterface $repository,Tag $tag)
+ public function destroy(TagRepositoryInterface $repository, Tag $tag)
{
$tagName = $tag->tag;
@@ -150,7 +150,7 @@ class TagController extends Controller
$count++;
}
}
- if($count > 1) {
+ if ($count > 1) {
$allowToAdvancePayment = false;
}
@@ -170,12 +170,12 @@ class TagController extends Controller
$count++;
}
}
- if($count > 0) {
+ if ($count > 0) {
$allowToBalancingAct = false;
}
- // edit tagoptions:
+ // edit tag options:
if ($allowToAdvancePayment === false) {
unset($tagOptions['advancePayment']);
}
@@ -195,6 +195,8 @@ class TagController extends Controller
/**
* @param $state
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
*/
public function hideTagHelp($state)
{
@@ -234,7 +236,11 @@ class TagController extends Controller
}
/**
- * @param TagFormRequest $request
+ * @param TagFormRequest $request
+ *
+ * @param TagRepositoryInterface $repository
+ *
+ * @return $this|\Illuminate\Http\RedirectResponse
*/
public function store(TagFormRequest $request, TagRepositoryInterface $repository)
{
diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php
index 05f928ab8b..68dbe811a3 100644
--- a/app/Http/Requests/DeleteAccountFormRequest.php
+++ b/app/Http/Requests/DeleteAccountFormRequest.php
@@ -26,7 +26,7 @@ class DeleteAccountFormRequest extends Request
public function rules()
{
return [
- 'password' => 'required',
+ 'password' => 'required',
];
}
}
diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php
index f82b055478..ad04f50a29 100644
--- a/app/Http/Requests/TagFormRequest.php
+++ b/app/Http/Requests/TagFormRequest.php
@@ -33,7 +33,7 @@ class TagFormRequest extends Request
*/
public function rules()
{
- $idRule = '';
+ $idRule = '';
$tagRule = 'required|min:1|uniqueObjectForUser:tags,tag,TRUE';
if (Tag::find(Input::get('id'))) {
$idRule = 'belongsToUser:tags';
diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php
index ad18780bcb..7a0a504a6d 100644
--- a/app/Http/breadcrumbs.php
+++ b/app/Http/breadcrumbs.php
@@ -9,9 +9,10 @@ use FireflyIII\Models\Category;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\Reminder;
+use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal;
-use FireflyIII\Models\Tag;
+
/*
* Back home.
*/
@@ -176,13 +177,13 @@ Breadcrumbs::register(
Breadcrumbs::register(
'currency.edit', function (Generator $breadcrumbs, TransactionCurrency $currency) {
$breadcrumbs->parent('currency.index');
- $breadcrumbs->push('Edit '.$currency->name, route('currency.edit', $currency->id));
+ $breadcrumbs->push('Edit ' . $currency->name, route('currency.edit', $currency->id));
}
);
Breadcrumbs::register(
'currency.delete', function (Generator $breadcrumbs, TransactionCurrency $currency) {
$breadcrumbs->parent('currency.index');
- $breadcrumbs->push('Delete '.$currency->name, route('currency.delete', $currency->id));
+ $breadcrumbs->push('Delete ' . $currency->name, route('currency.delete', $currency->id));
}
);
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 9756f34614..5a6ab19d83 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -145,8 +145,8 @@ Route::bind(
if (Auth::check()) {
/** @var \FireflyIII\Models\Reminder $object */
$object = Reminder::find($value);
- if($object) {
- if($object->remindersable->account->user_id == Auth::user()->id) {
+ if ($object) {
+ if ($object->remindersable->account->user_id == Auth::user()->id) {
return $object;
}
}
@@ -177,7 +177,7 @@ Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'r
Route::controllers(
[
- 'auth' => 'Auth\AuthController',
+ 'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]
);
@@ -350,8 +350,13 @@ Route::group(
// pop ups for budget report:
Route::get('/reports/modal/{account}/{year}/{month}/no-budget', ['uses' => 'ReportController@modalNoBudget', 'as' => 'reports.no-budget']);
- Route::get('/reports/modal/{account}/{year}/{month}/balanced-transfers', ['uses' => 'ReportController@modalBalancedTransfers', 'as' => 'reports.balanced-transfers']);
- Route::get('/reports/modal/{account}/{year}/{month}/left-unbalanced', ['uses' => 'ReportController@modalLeftUnbalanced', 'as' => 'reports.left-unbalanced']);
+ Route::get(
+ '/reports/modal/{account}/{year}/{month}/balanced-transfers',
+ ['uses' => 'ReportController@modalBalancedTransfers', 'as' => 'reports.balanced-transfers']
+ );
+ Route::get(
+ '/reports/modal/{account}/{year}/{month}/left-unbalanced', ['uses' => 'ReportController@modalLeftUnbalanced', 'as' => 'reports.left-unbalanced']
+ );
/**
* Search Controller
diff --git a/app/Models/Account.php b/app/Models/Account.php
index 2712aef197..77c8a66086 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -51,7 +51,7 @@ class Account extends Model
$account = Account::create($fields);
if (is_null($account->id)) {
// could not create account:
- App::abort(500, 'Could not create new account with data: ' . json_encode($fields).' because ' . json_encode($account->getErrors()));
+ App::abort(500, 'Could not create new account with data: ' . json_encode($fields) . ' because ' . json_encode($account->getErrors()));
}
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 60a8198571..12efc295b6 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -1,9 +1,10 @@
<?php namespace FireflyIII\Models;
+use App;
use Crypt;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
-use App;
+
/**
* Class Category
*
diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php
index fef1e0fe81..7d00585d6c 100644
--- a/app/Models/PiggyBank.php
+++ b/app/Models/PiggyBank.php
@@ -14,7 +14,7 @@ class PiggyBank extends Model
use SoftDeletes;
protected $fillable
- = ['name', 'account_id','order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
+ = ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
diff --git a/app/Models/Reminder.php b/app/Models/Reminder.php
index b8a62a2383..f6116b2754 100644
--- a/app/Models/Reminder.php
+++ b/app/Models/Reminder.php
@@ -78,6 +78,11 @@ class Reminder extends Model
return $query->where('reminders.startdate', '=', $start->format('Y-m-d 00:00:00'))->where('reminders.enddate', '=', $end->format('Y-m-d 00:00:00'));
}
+ /**
+ * @param EloquentBuilder $query
+ *
+ * @return $this
+ */
public function scopeToday(EloquentBuilder $query)
{
$today = new Carbon;
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index d965150c0a..cac823555c 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -52,9 +52,9 @@ class Tag extends Model
}
}
// create it!
- $fields['tagMode'] = 'nothing';
+ $fields['tagMode'] = 'nothing';
$fields['description'] = isset($fields['description']) && !is_null($fields['description']) ? $fields['description'] : '';
- $tag = Tag::create($fields);
+ $tag = Tag::create($fields);
if (is_null($tag->id)) {
// could not create account:
App::abort(500, 'Could not create new tag with data: ' . json_encode($fields) . ' because ' . json_encode($tag->getErrors()));
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index f0873c577b..f2d65060c5 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -66,8 +66,13 @@ class TransactionJournal extends Model
return floatval($t->amount);
}
}
+
+ return 0;
}
+ /**
+ * @return Account|mixed
+ */
public function getAssetAccountAttribute()
{
$positive = true; // the asset account is in the transaction with the positive amount.
diff --git a/app/Providers/ConfigServiceProvider.php b/app/Providers/ConfigServiceProvider.php
index bd01842727..b758d58acd 100644
--- a/app/Providers/ConfigServiceProvider.php
+++ b/app/Providers/ConfigServiceProvider.php
@@ -173,7 +173,7 @@ class ConfigServiceProvider extends ServiceProvider
],
'Form' => [
'is_safe' => [
- 'input', 'select', 'checkbox', 'model', 'open','radio','textarea'
+ 'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea'
]
],
],
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index e19c145043..a9d54e9e0f 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -6,6 +6,7 @@ use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankRepetition;
+use FireflyIII\Models\Reminder;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Support\Facades\Navigation;
@@ -13,7 +14,6 @@ use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Log;
-use FireflyIII\Models\Reminder;
/**
* Class EventServiceProvider
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index 330ff2fe81..9a4ab7d52f 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -231,7 +231,7 @@ class JournalRepository implements JournalRepositoryInterface
DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->whereNotIn('tag_id', $ids)->delete();
}
// if count is zero, delete them all:
- if(count($ids) == 0) {
+ if (count($ids) == 0) {
DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->delete();
}
diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php
index 4e0d31c102..e2a5c03bff 100644
--- a/app/Repositories/Tag/TagRepositoryInterface.php
+++ b/app/Repositories/Tag/TagRepositoryInterface.php
@@ -1,6 +1,7 @@
<?php
namespace FireflyIII\Repositories\Tag;
+
use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection;
@@ -11,7 +12,8 @@ use Illuminate\Support\Collection;
*
* @package FireflyIII\Repositories\Tag
*/
-interface TagRepositoryInterface {
+interface TagRepositoryInterface
+{
/**
* @param array $data
@@ -34,7 +36,7 @@ interface TagRepositoryInterface {
public function update(Tag $tag, array $data);
/**
- * @param Tag $tag
+ * @param Tag $tag
*
* @return boolean
*/
diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php
index 4d289a4b43..df4137670b 100644
--- a/app/Support/Twig/PiggyBank.php
+++ b/app/Support/Twig/PiggyBank.php
@@ -2,9 +2,9 @@
namespace FireflyIII\Support\Twig;
+use FireflyIII\Models\PiggyBank as PB;
use Twig_Extension;
use Twig_SimpleFunction;
-use FireflyIII\Models\PiggyBank as PB;
/**
* Class PiggyBank
@@ -26,6 +26,7 @@ class PiggyBank extends Twig_Extension
return $piggyBank->currentRelevantRep()->currentamount;
}
);
+
return $functions;
}