From 7eba33e80519702b078323d9e4fe5b7c2b7aa41e Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 27 May 2015 07:58:54 +0200 Subject: [PATCH] Fixed some issues for scrutiniser [skip ci] --- app/Http/Controllers/TagController.php | 2 +- app/Http/Controllers/TransactionController.php | 4 ++-- app/Models/Account.php | 1 - app/Models/Bill.php | 1 - app/Models/Category.php | 1 - app/Models/Reminder.php | 1 + app/Models/Transaction.php | 2 ++ app/Repositories/Bill/BillRepository.php | 2 +- app/Repositories/Tag/TagRepository.php | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 251a88ea2e..8473f1d5e3 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -164,7 +164,7 @@ class TagController extends Controller $state = $state == 'true' ? true : false; Preferences::set('hideTagHelp', $state); - return Response::json(true); + return Response::json([true]); } /** diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index b15f83427c..223dab527a 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -154,7 +154,7 @@ class TransactionController extends Controller } $preFilled['amount'] = $journal->actual_amount; - $preFilled['account_id'] = $journal->assetAccount->id; + $preFilled['account_id'] = $journal->asset_account->id; $preFilled['expense_account'] = $transactions[0]->account->name; $preFilled['revenue_account'] = $transactions[1]->account->name; $preFilled['account_from_id'] = $transactions[1]->account->id; @@ -236,7 +236,7 @@ class TransactionController extends Controller } } - return Response::json(true); + return Response::json([true]); } diff --git a/app/Models/Account.php b/app/Models/Account.php index 4f0737450b..cdc4c28088 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -40,7 +40,6 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account whereVirtualBalanceEncrypted($value) * @method static \FireflyIII\Models\Account accountTypeIn($types) * @method static \FireflyIII\Models\Account hasMetaValue($name, $value) - * * @property boolean joinedAccountTypes * @property mixed startBalance * @property mixed endBalance diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 125b25f480..70fab19668 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -44,7 +44,6 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereSkip($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereNameEncrypted($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereMatchEncrypted($value) - * * @property mixed nextExpectedMatch * @property mixed lastFoundMatch */ diff --git a/app/Models/Category.php b/app/Models/Category.php index 05c35149fa..3497fd9dc6 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -24,7 +24,6 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereEncrypted($value) - * * @property mixed spent * @property mixed lastActivity */ diff --git a/app/Models/Reminder.php b/app/Models/Reminder.php index 5b0b62bcfd..99baf19835 100644 --- a/app/Models/Reminder.php +++ b/app/Models/Reminder.php @@ -38,6 +38,7 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Reminder whereEncrypted($value) * @method static \FireflyIII\Models\Reminder onDates($start, $end) * @method static \FireflyIII\Models\Reminder today() + * @property string description */ class Reminder extends Model { diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 8b375090d3..827f6958e3 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -33,6 +33,8 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereAmountEncrypted($value) * @method static \FireflyIII\Models\Transaction after($date) * @method static \FireflyIII\Models\Transaction before($date) + * @property mixed before + * @property mixed after */ class Transaction extends Model { diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 93f774ed34..54ee071c66 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -241,7 +241,7 @@ class BillRepository implements BillRepositoryInterface $end = Navigation::endOfPeriod(clone $start, $bill->repeat_freq); $journalCount = $bill->transactionjournals()->before($end)->after($start)->count(); if ($journalCount == 0) { - $finalDate = clone $start; + $finalDate = new Carbon($start->format('Y-m-d')); break; } } diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index c18efc01af..358eeac892 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -323,7 +323,7 @@ class TagRepository implements TagRepositoryInterface $match = true; /** @var TransactionJournal $check */ foreach ($tag->transactionjournals as $check) { - if ($check->assetAccount->id != $journal->assetAccount->id) { + if ($check->asset_account->id != $journal->asset_account->id) { $match = false; } }