Reformat various code.

This commit is contained in:
James Cole
2022-03-29 15:00:29 +02:00
parent d1a09ff33b
commit d04efb8325
81 changed files with 662 additions and 662 deletions

View File

@@ -52,12 +52,12 @@ class AppendNotes implements ActionInterface
{
$dbNote = Note
::
where('noteable_id', (int)$journal['transaction_journal_id'])
where('noteable_id', (int) $journal['transaction_journal_id'])
->where('noteable_type', TransactionJournal::class)
->first(['notes.*']);
if (null === $dbNote) {
$dbNote = new Note;
$dbNote->noteable_id = (int)$journal['transaction_journal_id'];
$dbNote->noteable_id = (int) $journal['transaction_journal_id'];
$dbNote->noteable_type = TransactionJournal::class;
$dbNote->text = '';
}

View File

@@ -58,7 +58,7 @@ class LinkToBill implements ActionInterface
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->setUser($user);
$billName = (string)$this->action->action_value;
$billName = (string) $this->action->action_value;
$bill = $repository->findByName($billName);
if (null !== $bill && $journal['transaction_type_type'] === TransactionType::WITHDRAWAL) {

View File

@@ -52,12 +52,12 @@ class PrependNotes implements ActionInterface
{
$dbNote = Note
::
where('noteable_id', (int)$journal['transaction_journal_id'])
where('noteable_id', (int) $journal['transaction_journal_id'])
->where('noteable_type', TransactionJournal::class)
->first(['notes.*']);
if (null === $dbNote) {
$dbNote = new Note;
$dbNote->noteable_id = (int)$journal['transaction_journal_id'];
$dbNote->noteable_id = (int) $journal['transaction_journal_id'];
$dbNote->noteable_type = TransactionJournal::class;
$dbNote->text = '';
}

View File

@@ -58,7 +58,7 @@ class SetDestinationAccount implements ActionInterface
$user = User::find($journal['user_id']);
$type = $journal['transaction_type_type'];
/** @var TransactionJournal|null $object */
$object = $user->transactionJournals()->find((int)$journal['transaction_journal_id']);
$object = $user->transactionJournals()->find((int) $journal['transaction_journal_id']);
$this->repository = app(AccountRepositoryInterface::class);
if (null === $object) {
@@ -95,7 +95,7 @@ class SetDestinationAccount implements ActionInterface
return false;
}
if (null !== $newAccount && (int)$newAccount->id === (int)$source->account_id) {
if (null !== $newAccount && (int) $newAccount->id === (int) $source->account_id) {
Log::error(
sprintf(
'New destination account ID #%d and current source account ID #%d are the same. Do nothing.', $newAccount->id,

View File

@@ -61,7 +61,7 @@ class UpdatePiggybank implements ActionInterface
// refresh the transaction type.
$user = User::find($journal['user_id']);
$journalObj = $user->transactionJournals()->find($journal['transaction_journal_id']);
$type = TransactionType::find((int)$journalObj->transaction_type_id);
$type = TransactionType::find((int) $journalObj->transaction_type_id);
$journal['transaction_type_type'] = $type->type;
if (TransactionType::TRANSFER !== $journal['transaction_type_type']) {
@@ -86,13 +86,13 @@ class UpdatePiggybank implements ActionInterface
/** @var Transaction $destination */
$destination = Transaction::where('transaction_journal_id', $journal['transaction_journal_id'])->where('amount', '>', 0)->first();
if ((int)$source->account_id === (int)$piggyBank->account_id) {
if ((int) $source->account_id === (int) $piggyBank->account_id) {
Log::debug('Piggy bank account is linked to source, so remove amount.');
$this->removeAmount($journal, $piggyBank, $destination->amount);
return true;
}
if ((int)$destination->account_id === (int)$piggyBank->account_id) {
if ((int) $destination->account_id === (int) $piggyBank->account_id) {
Log::debug('Piggy bank account is linked to source, so add amount.');
$this->addAmount($journal, $piggyBank, $destination->amount);