Various code cleanup.

This commit is contained in:
James Cole
2021-04-07 07:28:43 +02:00
parent 4ddcb0c965
commit f12744ad8c
180 changed files with 714 additions and 721 deletions

View File

@@ -111,16 +111,16 @@ 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 = redirect($this->getPreviousUri('piggy-banks.create.uri'));
if (1 === (int)$request->get('create_another')) {
// @codeCoverageIgnoreStart
session()->put('piggy-banks.create.fromStore', true);
$redirect = redirect(route('piggy-banks.create'))->withInput();
// @codeCoverageIgnoreEnd
}
return $redirect;

View File

@@ -132,16 +132,16 @@ 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 = redirect($this->getPreviousUri('piggy-banks.edit.uri'));
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
session()->put('piggy-banks.edit.fromUpdate', true);
$redirect = redirect(route('piggy-banks.edit', [$piggyBank->id]));
// @codeCoverageIgnoreEnd
}
return $redirect;

View File

@@ -112,7 +112,7 @@ class IndexController extends Controller
$account = $accountTransformer->transform($piggy->account);
$accountId = (int)$account['id'];
$array['attachments'] = $this->piggyRepos->getAttachments($piggy);
if (!isset($accounts[$accountId])) {
if (!array_key_exists($accountId, $accounts)) {
// create new:
$accounts[$accountId] = $account;