mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Code clean up
This commit is contained in:
@@ -12,7 +12,6 @@ declare(strict_types = 1);
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Models\Account;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -43,7 +42,7 @@ class AccountList implements BinderInterface
|
||||
/** @var \Illuminate\Support\Collection $object */
|
||||
$object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||
->whereIn('accounts.id', $ids)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where('user_id', auth()->user()->id)
|
||||
->get(['accounts.*']);
|
||||
if ($object->count() > 0) {
|
||||
return $object;
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Models\Budget;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -38,7 +37,7 @@ class BudgetList implements BinderInterface
|
||||
/** @var \Illuminate\Support\Collection $object */
|
||||
$object = Budget::where('active', 1)
|
||||
->whereIn('id', $ids)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where('user_id', auth()->user()->id)
|
||||
->get();
|
||||
|
||||
// add empty budget if applicable.
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Models\Category;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -36,7 +35,7 @@ class CategoryList implements BinderInterface
|
||||
$ids = explode(',', $value);
|
||||
/** @var \Illuminate\Support\Collection $object */
|
||||
$object = Category::whereIn('id', $ids)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where('user_id', auth()->user()->id)
|
||||
->get();
|
||||
|
||||
// add empty category if applicable.
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use FireflyIII\Helpers\FiscalHelper;
|
||||
@@ -42,7 +41,7 @@ class Date implements BinderInterface
|
||||
try {
|
||||
$date = new Carbon($value);
|
||||
} catch (Exception $e) {
|
||||
Log::error('Could not parse date "' . $value . '" for user #' . Auth::user()->id);
|
||||
Log::error('Could not parse date "' . $value . '" for user #' . auth()->user()->id);
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -37,7 +36,7 @@ class JournalList implements BinderInterface
|
||||
/** @var \Illuminate\Support\Collection $object */
|
||||
$object = TransactionJournal::whereIn('transaction_journals.id', $ids)
|
||||
->expanded()
|
||||
->where('transaction_journals.user_id', Auth::user()->id)
|
||||
->where('transaction_journals.user_id', auth()->user()->id)
|
||||
->get(TransactionJournal::queryFields());
|
||||
|
||||
if ($object->count() > 0) {
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
@@ -36,7 +35,7 @@ class UnfinishedJournal implements BinderInterface
|
||||
$object = TransactionJournal::where('transaction_journals.id', $value)
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('completed', 0)
|
||||
->where('user_id', Auth::user()->id)->first(['transaction_journals.*']);
|
||||
->where('user_id', auth()->user()->id)->first(['transaction_journals.*']);
|
||||
if ($object) {
|
||||
return $object;
|
||||
}
|
||||
|
Reference in New Issue
Block a user