mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-23 12:27:05 +00:00
Various code cleanup.
This commit is contained in:
@@ -156,7 +156,7 @@ class CreateController extends Controller
|
||||
}
|
||||
|
||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||
}
|
||||
|
||||
// redirect to previous URL.
|
||||
|
@@ -72,7 +72,7 @@ class DeleteController extends Controller
|
||||
public function delete(Account $account)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
$typeName = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||
@@ -98,7 +98,7 @@ class DeleteController extends Controller
|
||||
public function destroy(Request $request, Account $account)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
$type = $account->accountType->type;
|
||||
|
@@ -84,7 +84,7 @@ class EditController extends Controller
|
||||
public function edit(Request $request, Account $account, AccountRepositoryInterface $repository)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
$objectType = config('firefly.shortNamesByFullName')[$account->accountType->type];
|
||||
@@ -177,7 +177,7 @@ class EditController extends Controller
|
||||
public function update(AccountFormRequest $request, Account $account)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
$data = $request->getAccountData();
|
||||
@@ -195,7 +195,7 @@ class EditController extends Controller
|
||||
}
|
||||
|
||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||
}
|
||||
|
||||
// redirect
|
||||
|
@@ -91,14 +91,14 @@ class ReconcileController extends Controller
|
||||
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
if (AccountType::ASSET !== $account->accountType->type) {
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
session()->flash('error', (string)trans('firefly.must_be_asset_account'));
|
||||
|
||||
return redirect(route('accounts.index', [config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type))]));
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
}
|
||||
$currency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||
|
||||
@@ -106,7 +106,7 @@ class ReconcileController extends Controller
|
||||
$range = app('preferences')->get('viewRange', '1M')->data;
|
||||
|
||||
// get start and end
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
if (null === $start && null === $end) {
|
||||
|
||||
/** @var Carbon $start */
|
||||
@@ -118,7 +118,7 @@ class ReconcileController extends Controller
|
||||
/** @var Carbon $end */
|
||||
$end = app('navigation')->endOfPeriod($start, $range);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
if ($end->lt($start)) {
|
||||
[$start, $end] = [$end, $start];
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class ReconcileController extends Controller
|
||||
public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
Log::debug('In ReconcileController::submit()');
|
||||
@@ -217,7 +217,7 @@ class ReconcileController extends Controller
|
||||
private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
$reconciliation = $this->accountRepos->getReconciliation($account);
|
||||
|
@@ -91,7 +91,7 @@ class ShowController extends Controller
|
||||
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
|
||||
/** @var Carbon $start */
|
||||
@@ -100,7 +100,7 @@ class ShowController extends Controller
|
||||
$end = $end ?? session('end');
|
||||
|
||||
if ($end < $start) {
|
||||
[$start, $end] = [$end, $start]; // @codeCoverageIgnore
|
||||
[$start, $end] = [$end, $start];
|
||||
}
|
||||
$location = $this->repository->getLocation($account);
|
||||
$attachments = $this->repository->getAttachments($account);
|
||||
@@ -164,7 +164,7 @@ class ShowController extends Controller
|
||||
public function showAll(Request $request, Account $account)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
|
||||
return $this->redirectAccountToAccount($account);
|
||||
}
|
||||
$location = $this->repository->getLocation($account);
|
||||
$isLiability = $this->repository->isLiability($account);
|
||||
|
Reference in New Issue
Block a user