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