mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 11:45:14 +00:00
Various fixes for tests and code quality.
This commit is contained in:
@@ -36,11 +36,11 @@ use Illuminate\Http\Request;
|
|||||||
*/
|
*/
|
||||||
class CreateController extends Controller
|
class CreateController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* CreateController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -60,6 +60,8 @@ class CreateController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new account.
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param string|null $what
|
* @param string|null $what
|
||||||
*
|
*
|
||||||
@@ -90,6 +92,8 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Store the new account.
|
||||||
|
*
|
||||||
* @param AccountFormRequest $request
|
* @param AccountFormRequest $request
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
@@ -30,16 +30,15 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Class DeleteController
|
* Class DeleteController
|
||||||
*/
|
*/
|
||||||
class DeleteController extends Controller
|
class DeleteController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* DeleteController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -59,6 +58,8 @@ class DeleteController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Delete account screen.
|
||||||
|
*
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
@@ -77,6 +78,8 @@ class DeleteController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Delete the account.
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
|
@@ -37,13 +37,13 @@ use Illuminate\Http\Request;
|
|||||||
*/
|
*/
|
||||||
class EditController extends Controller
|
class EditController extends Controller
|
||||||
{
|
{
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
private $currencyRepos;
|
private $currencyRepos;
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* EditController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -64,6 +64,8 @@ class EditController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Edit account overview.
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
* @param AccountRepositoryInterface $repository
|
* @param AccountRepositoryInterface $repository
|
||||||
@@ -120,6 +122,8 @@ class EditController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Update the account.
|
||||||
|
*
|
||||||
* @param AccountFormRequest $request
|
* @param AccountFormRequest $request
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
|
@@ -36,11 +36,11 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
|||||||
*/
|
*/
|
||||||
class IndexController extends Controller
|
class IndexController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* IndexController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -60,6 +60,8 @@ class IndexController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Show list of accounts.
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param string $what
|
* @param string $what
|
||||||
*
|
*
|
||||||
@@ -106,6 +108,8 @@ class IndexController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Find the ID in a given array. Return '0' of not there (amount).
|
||||||
|
*
|
||||||
* @param array $array
|
* @param array $array
|
||||||
* @param int $entryId
|
* @param int $entryId
|
||||||
*
|
*
|
||||||
|
@@ -45,15 +45,15 @@ use Log;
|
|||||||
*/
|
*/
|
||||||
class ReconcileController extends Controller
|
class ReconcileController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $accountRepos;
|
private $accountRepos;
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
private $currencyRepos;
|
private $currencyRepos;
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* ReconcileController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -74,6 +74,8 @@ class ReconcileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Edit a reconciliation.
|
||||||
|
*
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
@@ -110,6 +112,8 @@ class ReconcileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Reconciliation overview.
|
||||||
|
*
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
* @param Carbon|null $start
|
* @param Carbon|null $start
|
||||||
* @param Carbon|null $end
|
* @param Carbon|null $end
|
||||||
@@ -168,6 +172,8 @@ class ReconcileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Show a single reconciliation.
|
||||||
|
*
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||||
@@ -193,6 +199,8 @@ class ReconcileController extends Controller
|
|||||||
|
|
||||||
/** @noinspection MoreThanThreeArgumentsInspection */
|
/** @noinspection MoreThanThreeArgumentsInspection */
|
||||||
/**
|
/**
|
||||||
|
* Submit a new reconciliation.
|
||||||
|
*
|
||||||
* @param ReconciliationStoreRequest $request
|
* @param ReconciliationStoreRequest $request
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
@@ -278,6 +286,8 @@ class ReconcileController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Update a reconciliation.
|
||||||
|
*
|
||||||
* @param ReconciliationUpdateRequest $request
|
* @param ReconciliationUpdateRequest $request
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
@@ -359,6 +369,8 @@ class ReconcileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Redirect user to the original asset account.
|
||||||
|
*
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
@@ -45,13 +45,13 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class ShowController extends Controller
|
class ShowController extends Controller
|
||||||
{
|
{
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
private $currencyRepos;
|
private $currencyRepos;
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* ShowController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -241,6 +241,8 @@ class ShowController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Redirect to the original account.
|
||||||
|
*
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
@@ -43,7 +43,7 @@ use Log;
|
|||||||
class NoCategoryController extends Controller
|
class NoCategoryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $journalRepos;
|
private $journalRepos;
|
||||||
/** @var CategoryRepositoryInterface */
|
/** @var CategoryRepositoryInterface */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
@@ -47,9 +47,9 @@ use Illuminate\Support\Collection;
|
|||||||
class ShowController extends Controller
|
class ShowController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $accountRepos;
|
private $accountRepos;
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $journalRepos;
|
private $journalRepos;
|
||||||
/** @var CategoryRepositoryInterface */
|
/** @var CategoryRepositoryInterface */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
@@ -43,7 +43,7 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class ExpenseReportController extends Controller
|
class ExpenseReportController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
protected $accountRepository;
|
protected $accountRepository;
|
||||||
/** @var GeneratorInterface */
|
/** @var GeneratorInterface */
|
||||||
protected $generator;
|
protected $generator;
|
||||||
|
@@ -38,7 +38,7 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class CurrencyController extends Controller
|
class CurrencyController extends Controller
|
||||||
{
|
{
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
protected $repository;
|
protected $repository;
|
||||||
|
|
||||||
/** @var UserRepositoryInterface */
|
/** @var UserRepositoryInterface */
|
||||||
|
@@ -50,9 +50,9 @@ class ReconcileController extends Controller
|
|||||||
|
|
||||||
/** @var CurrencyUpdateService */
|
/** @var CurrencyUpdateService */
|
||||||
private $accountRepos;
|
private $accountRepos;
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $currencyRepos;
|
private $currencyRepos;
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -34,7 +34,7 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class NewUserController extends Controller
|
class NewUserController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,9 +47,9 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
|||||||
class PiggyBankController extends Controller
|
class PiggyBankController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $accountRepos;
|
private $accountRepos;
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
private $currencyRepos;
|
private $currencyRepos;
|
||||||
/** @var PiggyBankRepositoryInterface */
|
/** @var PiggyBankRepositoryInterface */
|
||||||
private $piggyRepos;
|
private $piggyRepos;
|
||||||
|
@@ -44,7 +44,7 @@ use Throwable;
|
|||||||
*/
|
*/
|
||||||
class ReportController extends Controller
|
class ReportController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $accountRepository;
|
private $accountRepository;
|
||||||
/** @var BudgetRepositoryInterface */
|
/** @var BudgetRepositoryInterface */
|
||||||
private $budgetRepository;
|
private $budgetRepository;
|
||||||
|
@@ -42,7 +42,7 @@ use Throwable;
|
|||||||
*/
|
*/
|
||||||
class ExpenseController extends Controller
|
class ExpenseController extends Controller
|
||||||
{
|
{
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
protected $accountRepository;
|
protected $accountRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -48,7 +48,7 @@ use Throwable;
|
|||||||
class SelectController extends Controller
|
class SelectController extends Controller
|
||||||
{
|
{
|
||||||
use RuleManagement;
|
use RuleManagement;
|
||||||
/** @var AccountRepositoryInterface */
|
/** @var AccountRepositoryInterface The account repository */
|
||||||
private $accountRepos;
|
private $accountRepos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,7 +37,7 @@ use Log;
|
|||||||
*/
|
*/
|
||||||
class BulkController extends Controller
|
class BulkController extends Controller
|
||||||
{
|
{
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class ConvertController extends Controller
|
class ConvertController extends Controller
|
||||||
{
|
{
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,7 @@ use URL;
|
|||||||
*/
|
*/
|
||||||
class LinkController extends Controller
|
class LinkController extends Controller
|
||||||
{
|
{
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $journalRepository;
|
private $journalRepository;
|
||||||
/** @var LinkTypeRepositoryInterface */
|
/** @var LinkTypeRepositoryInterface */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
@@ -47,7 +47,7 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
|||||||
*/
|
*/
|
||||||
class MassController extends Controller
|
class MassController extends Controller
|
||||||
{
|
{
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -50,7 +50,7 @@ class SingleController extends Controller
|
|||||||
private $attachments;
|
private $attachments;
|
||||||
/** @var BudgetRepositoryInterface */
|
/** @var BudgetRepositoryInterface */
|
||||||
private $budgets;
|
private $budgets;
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -52,9 +52,9 @@ class SplitController extends Controller
|
|||||||
/** @var BudgetRepositoryInterface */
|
/** @var BudgetRepositoryInterface */
|
||||||
private $budgets;
|
private $budgets;
|
||||||
|
|
||||||
/** @var CurrencyRepositoryInterface */
|
/** @var CurrencyRepositoryInterface The currency repository */
|
||||||
private $currencies;
|
private $currencies;
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -50,7 +50,7 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class TransactionController extends Controller
|
class TransactionController extends Controller
|
||||||
{
|
{
|
||||||
/** @var JournalRepositoryInterface */
|
/** @var JournalRepositoryInterface Journals and transactions overview */
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -41,7 +41,7 @@ class FromAccountIsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
|
|
||||||
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
||||||
|
@@ -52,7 +52,7 @@ class FromAccountStartsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
$name = $account->name ?? '';
|
$name = $account->name ?? '';
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class FromAccountStartsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
$name = $account->name ?? '';
|
$name = $account->name ?? '';
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class ToAccountEndsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
$name = $account->name ?? '';
|
$name = $account->name ?? '';
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ class ToAccountEndsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
$name = $account->name ?? '';
|
$name = $account->name ?? '';
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class ToAccountEndsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
$name = $account->name ?? '';
|
$name = $account->name ?? '';
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class ToAccountIsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
|
|
||||||
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
||||||
@@ -69,7 +69,7 @@ class ToAccountIsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
|
|
||||||
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
||||||
|
@@ -44,10 +44,10 @@ class ToAccountStartsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
|
|
||||||
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null === $account));
|
||||||
|
|
||||||
$loops++;
|
$loops++;
|
||||||
|
|
||||||
@@ -73,10 +73,10 @@ class ToAccountStartsTest extends TestCase
|
|||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
|
||||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
$account = $transaction->account;
|
$account = null === $transaction ? null : $transaction->account;
|
||||||
$count = $journal->transactions()->count();
|
$count = $journal->transactions()->count();
|
||||||
|
|
||||||
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null===$account));
|
Log::debug(sprintf('Loop: %d, transaction count: %d, account is null: %d', $loops, $count, (int)null === $account));
|
||||||
|
|
||||||
$loops++;
|
$loops++;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user