mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup and realign.
This commit is contained in:
@@ -70,7 +70,7 @@ class AccountFormRequest extends Request
|
||||
|
||||
// if the account type is "liabilities" there are actually four types of liability
|
||||
// that could have been selected.
|
||||
if ($data['accountType'] === 'liabilities') {
|
||||
if ('liabilities' === $data['accountType']) {
|
||||
$data['accountType'] = null;
|
||||
$data['account_type_id'] = $this->integer('liability_type_id');
|
||||
// also reverse the opening balance:
|
||||
|
@@ -270,7 +270,7 @@ class JournalFormRequest extends Request
|
||||
*/
|
||||
private function validateDeposit(Validator $validator): void
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$data = $validator->getData();
|
||||
$selectedCurrency = (int)($data['amount_currency_id_amount'] ?? 0);
|
||||
$accountCurrency = (int)($data['destination_account_currency'] ?? 0);
|
||||
$nativeAmount = (string)($data['native_amount'] ?? '');
|
||||
@@ -290,7 +290,7 @@ class JournalFormRequest extends Request
|
||||
*/
|
||||
private function validateTransfer(Validator $validator): void
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$data = $validator->getData();
|
||||
$sourceCurrency = (int)($data['source_account_currency'] ?? 0);
|
||||
$destinationCurrency = (int)($data['destination_account_currency'] ?? 0);
|
||||
$sourceAmount = (string)($data['source_amount'] ?? '');
|
||||
|
@@ -150,7 +150,7 @@ class RecurrenceFormRequest extends Request
|
||||
{
|
||||
$today = new Carbon;
|
||||
$tomorrow = Carbon::now()->addDay();
|
||||
$rules = [
|
||||
$rules = [
|
||||
// mandatory info for recurrence.
|
||||
'title' => 'required|between:1,255|uniqueObjectForUser:recurrences,title',
|
||||
'first_date' => 'required|date|after:' . $today->format('Y-m-d'),
|
||||
|
@@ -61,9 +61,10 @@ class Request extends FormRequest
|
||||
public function float(string $field): ?float
|
||||
{
|
||||
$res = $this->get($field);
|
||||
if(null === $res) {
|
||||
if (null === $res) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (float)$res;
|
||||
}
|
||||
|
||||
|
@@ -61,6 +61,7 @@ class RuleFormRequest extends Request
|
||||
'rule_triggers' => $this->getRuleTriggerData(),
|
||||
'rule_actions' => $this->getRuleActionData(),
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -109,8 +110,8 @@ class RuleFormRequest extends Request
|
||||
*/
|
||||
private function getRuleActionData(): array
|
||||
{
|
||||
$return = [];
|
||||
$actionData= $this->get('rule_actions');
|
||||
$return = [];
|
||||
$actionData = $this->get('rule_actions');
|
||||
if (\is_array($actionData)) {
|
||||
foreach ($actionData as $action) {
|
||||
$stopProcessing = $action['stop_processing'] ?? '0';
|
||||
|
Reference in New Issue
Block a user