diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 3dd13231e2..488245e61a 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -272,15 +272,15 @@ class ReportQuery implements ReportQueryInterface // only get deposits not to a shared account // and transfers to a shared account. $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Deposit'); $q->where('acm_to.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_from.data', '=', '"sharedAsset"'); } @@ -427,15 +427,15 @@ class ReportQuery implements ReportQueryInterface // get all withdrawals not from a shared accounts // and all transfers to a shared account $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Withdrawal'); $q->where('acm_from.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_to.data', '=', '"sharedAsset"'); } @@ -495,15 +495,15 @@ class ReportQuery implements ReportQueryInterface // show queries where transfer type is deposit, and its not to a shared account // or where its a transfer and its from a shared account (both count as incomes) $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Deposit'); $q->where('acm_to.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_from.data', '=', '"sharedAsset"'); } diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 26051e16d0..9cf2d0918e 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -7,6 +7,7 @@ use FireflyIII\Http\Requests; use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Pagination\LengthAwarePaginator; use Input; use Redirect; @@ -124,7 +125,7 @@ class AccountController extends Controller // move to repository: $set = Auth::user()->accounts()->with( - ['accountmeta' => function ($query) { + ['accountmeta' => function (HasMany $query) { $query->where('name', 'accountRole'); }] )->accountTypeIn($types)->take($size)->offset($offset)->orderBy('accounts.name', 'ASC')->get(['accounts.*']); diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 0f3a19dde7..a4fd311bfd 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -5,6 +5,7 @@ use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Registrar; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; use Illuminate\Http\Request; +use Illuminate\Mail\Message; use Mail; use Session; @@ -73,7 +74,7 @@ class AuthController extends Controller // send email. Mail::send( - 'emails.registered', [], function ($message) use ($email) { + 'emails.registered', [], function (Message $message) use ($email) { $message->to($email, $email)->subject('Welcome to Firefly III!'); } ); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index f014b3c53a..23b18019a4 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -2,6 +2,7 @@ use Closure; use Illuminate\Contracts\Auth\Guard; +use Illuminate\Http\Request; /** * Class Authenticate @@ -37,7 +38,7 @@ class Authenticate * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->guest()) { if ($request->ajax()) { diff --git a/app/Http/Middleware/PiggyBanks.php b/app/Http/Middleware/PiggyBanks.php index 1584f94175..4e6aebc9a4 100644 --- a/app/Http/Middleware/PiggyBanks.php +++ b/app/Http/Middleware/PiggyBanks.php @@ -10,6 +10,7 @@ use FireflyIII\Models\PiggyBankRepetition; use FireflyIII\Models\Reminder; use Illuminate\Contracts\Auth\Guard; use Illuminate\Database\Query\JoinClause; +use Illuminate\Http\Request; use Illuminate\Support\Collection; use Navigation; use Session; @@ -48,7 +49,7 @@ class PiggyBanks * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check() && !$request->isXmlHttpRequest()) { // get piggy banks without a repetition: diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index b37db6b6b4..3b7cc69bc8 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -6,6 +6,7 @@ namespace FireflyIII\Http\Middleware; use Carbon\Carbon; use Closure; use Illuminate\Contracts\Auth\Guard; +use Illuminate\Http\Request; use Navigation; use Preferences; use Session; @@ -44,7 +45,7 @@ class Range * * @return mixed */ - public function handle($request, Closure $theNext) + public function handle(Request $request, Closure $theNext) { if ($this->auth->check()) { diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 5033c35130..237bbe02ce 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -3,6 +3,7 @@ use Closure; use Illuminate\Contracts\Auth\Guard; use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; /** * Class RedirectIfAuthenticated @@ -38,7 +39,7 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check()) { return new RedirectResponse(url('/')); diff --git a/app/Http/Middleware/Reminders.php b/app/Http/Middleware/Reminders.php index 3bc152328f..2c0c15b046 100644 --- a/app/Http/Middleware/Reminders.php +++ b/app/Http/Middleware/Reminders.php @@ -8,6 +8,7 @@ use Closure; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\Reminder; use Illuminate\Contracts\Auth\Guard; +use Illuminate\Http\Request; use View; /** @@ -43,7 +44,7 @@ class Reminders * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check() && !$request->isXmlHttpRequest()) { // do reminders stuff. diff --git a/app/Http/Middleware/ReplaceTestVars.php b/app/Http/Middleware/ReplaceTestVars.php index 3af1d24641..2f48ac76b9 100644 --- a/app/Http/Middleware/ReplaceTestVars.php +++ b/app/Http/Middleware/ReplaceTestVars.php @@ -5,14 +5,15 @@ namespace FireflyIII\Http\Middleware; use Closure; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Routing\Middleware; +use Illuminate\Http\Request; use Log; /** * Class ReplaceTestVars * - * @package App\Http\Middleware + * @package FireflyIII\Http\Middleware */ -class ReplaceTestVars implements Middleware +class ReplaceTestVars { /** * The application implementation. @@ -40,7 +41,7 @@ class ReplaceTestVars implements Middleware * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ('testing' === $this->app->environment() && $request->has('_token')) { $input = $request->all(); diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 038542c0bc..42b7c3122e 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -5,7 +5,7 @@ namespace FireflyIII\Http\Requests; use Auth; use FireflyIII\Models\Account; use Input; - +use Exception; /** * Class JournalFormRequest * @@ -62,7 +62,7 @@ class JournalFormRequest extends Request $rules['category'] = 'between:1,255'; break; default: - die('Cannot handle ' . $what); + throw new Exception('Cannot handle ' . $what); break; }