diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 986d324e50..d8134a6110 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -53,7 +53,7 @@ class ReportHelper implements ReportHelperInterface * @param Carbon $end * @param $shared * - * @return Account + * @return AccountCollection */ public function getAccountReport(Carbon $date, Carbon $end, $shared) { diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index 13bef6fb67..e1e0a3df1a 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -3,10 +3,11 @@ namespace FireflyIII\Helpers\Report; use Carbon\Carbon; -use FireflyIII\Helpers\Collection\Account; +use FireflyIII\Helpers\Collection\Account as AccountCollection; use FireflyIII\Helpers\Collection\Balance; use FireflyIII\Helpers\Collection\Budget as BudgetCollection; use FireflyIII\Helpers\Collection\Category as CategoryCollection; +use FireflyIII\Helpers\Collection\Bill as BillCollection; use FireflyIII\Helpers\Collection\Expense; use FireflyIII\Helpers\Collection\Income; @@ -26,7 +27,7 @@ interface ReportHelperInterface * @param Carbon $end * @param boolean $shared * - * @return Account + * @return AccountCollection */ public function getAccountReport(Carbon $date, Carbon $end, $shared); @@ -38,7 +39,7 @@ interface ReportHelperInterface * @param Carbon $end * @param boolean $shared * - * @return Account + * @return BillCollection */ public function getBillReport(Carbon $start, Carbon $end, $shared); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index d6ebe48f18..43616f360b 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -240,11 +240,6 @@ class PiggyBankController extends Controller // create event $repository->createEvent($piggyBank, $amount); - /* - * Create event! - */ - //Event::fire('piggy_bank.addMoney', [$piggyBank, $amount]); // new and used. - Session::flash('success', 'Added ' . Amount::format($amount, false) . ' to "' . e($piggyBank->name) . '".'); } else { Session::flash('error', 'Could not add ' . Amount::format($amount, false) . ' to "' . e($piggyBank->name) . '".'); diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 1e3d4e0d53..914eae0583 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -2,6 +2,7 @@ namespace FireflyIII\Http\Requests; +use App; use Auth; use Carbon\Carbon; use Exception; @@ -85,7 +86,7 @@ class JournalFormRequest extends Request $rules['category'] = 'between:1,255'; break; default: - throw new Exception('Cannot handle ' . $what); + App::abort(500, 'Cannot handle ' . $what); break; } diff --git a/app/Http/routes.php b/app/Http/routes.php index c44686eda1..02631fcac4 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -13,10 +13,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; // models -/** @noinspection PhpUnusedParameterInspection */ Route::bind( 'account', - function ($value, $route) { + function ($value) { if (Auth::check()) { $object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') ->where('account_types.editable', 1) @@ -31,9 +30,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'tj', function ($value, $route) { + 'tj', function ($value) { if (Auth::check()) { $object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) { @@ -45,9 +43,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'currency', function ($value, $route) { + 'currency', function ($value) { if (Auth::check()) { $object = TransactionCurrency::find($value); if ($object) { @@ -58,9 +55,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'bill', function ($value, $route) { + 'bill', function ($value) { if (Auth::check()) { $object = Bill::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) { @@ -72,9 +68,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'budget', function ($value, $route) { + 'budget', function ($value) { if (Auth::check()) { $object = Budget::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) { @@ -86,9 +81,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'reminder', function ($value, $route) { + 'reminder', function ($value) { if (Auth::check()) { $object = Reminder::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) { @@ -100,9 +94,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'limitrepetition', function ($value, $route) { + 'limitrepetition', function ($value) { if (Auth::check()) { $object = LimitRepetition::where('limit_repetitions.id', $value) ->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id') @@ -118,9 +111,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'piggyBank', function ($value, $route) { + 'piggyBank', function ($value) { if (Auth::check()) { $object = PiggyBank::where('piggy_banks.id', $value) ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id') @@ -135,9 +127,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'category', function ($value, $route) { + 'category', function ($value) { if (Auth::check()) { $object = Category::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) { @@ -151,7 +142,7 @@ Route::bind( /** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'reminder', function ($value, $route) { + 'reminder', function ($value) { if (Auth::check()) { /** @var \FireflyIII\Models\Reminder $object */ $object = Reminder::find($value); @@ -166,9 +157,8 @@ Route::bind( } ); -/** @noinspection PhpUnusedParameterInspection */ Route::bind( - 'tag', function ($value, $route) { + 'tag', function ($value) { if (Auth::check()) { $object = Tag::where('id', $value)->where('user_id', Auth::user()->id)->first(); if ($object) {