mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Reformat various code.
This commit is contained in:
@@ -144,7 +144,7 @@ trait RecurringTransactionTrait
|
||||
if (!$validator->validateDestination(['id' => $destination->id])) {
|
||||
throw new FireflyException(sprintf('Destination invalid: %s', $validator->destError));
|
||||
}
|
||||
if (array_key_exists('foreign_amount', $array) && '' === (string)$array['foreign_amount']) {
|
||||
if (array_key_exists('foreign_amount', $array) && '' === (string) $array['foreign_amount']) {
|
||||
unset($array['foreign_amount']);
|
||||
}
|
||||
// See reference nr. 100
|
||||
@@ -156,25 +156,25 @@ trait RecurringTransactionTrait
|
||||
'source_id' => $source->id,
|
||||
'destination_id' => $destination->id,
|
||||
'amount' => $array['amount'],
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $array) ? (string)$array['foreign_amount'] : null,
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $array) ? (string) $array['foreign_amount'] : null,
|
||||
'description' => $array['description'],
|
||||
]
|
||||
);
|
||||
$transaction->save();
|
||||
|
||||
if (array_key_exists('budget_id', $array)) {
|
||||
$this->setBudget($transaction, (int)$array['budget_id']);
|
||||
$this->setBudget($transaction, (int) $array['budget_id']);
|
||||
}
|
||||
if (array_key_exists('bill_id', $array)) {
|
||||
$this->setBill($transaction, (int)$array['bill_id']);
|
||||
$this->setBill($transaction, (int) $array['bill_id']);
|
||||
}
|
||||
if (array_key_exists('category_id', $array)) {
|
||||
$this->setCategory($transaction, (int)$array['category_id']);
|
||||
$this->setCategory($transaction, (int) $array['category_id']);
|
||||
}
|
||||
|
||||
// same for piggy bank
|
||||
if (array_key_exists('piggy_bank_id', $array)) {
|
||||
$this->updatePiggyBank($transaction, (int)$array['piggy_bank_id']);
|
||||
$this->updatePiggyBank($transaction, (int) $array['piggy_bank_id']);
|
||||
}
|
||||
|
||||
if (array_key_exists('tags', $array) && is_array($array['tags'])) {
|
||||
@@ -194,14 +194,14 @@ trait RecurringTransactionTrait
|
||||
protected function findAccount(array $expectedTypes, ?int $accountId, ?string $accountName): Account
|
||||
{
|
||||
$result = null;
|
||||
$accountId = (int)$accountId;
|
||||
$accountName = (string)$accountName;
|
||||
$accountId = (int) $accountId;
|
||||
$accountName = (string) $accountName;
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
// if user has submitted an account ID, search for it.
|
||||
$result = $repository->find((int)$accountId);
|
||||
$result = $repository->find((int) $accountId);
|
||||
if (null !== $result) {
|
||||
return $result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user