Reformat various code.

This commit is contained in:
James Cole
2022-03-29 14:58:06 +02:00
parent 1209c4e76a
commit 29bed2547c
140 changed files with 1004 additions and 1010 deletions

View File

@@ -44,7 +44,7 @@ class JournalLinkRequest extends FormRequest
$return = [];
$linkType = $this->get('link_type');
$parts = explode('_', $linkType);
$return['link_type_id'] = (int)$parts[0];
$return['link_type_id'] = (int) $parts[0];
$return['transaction_journal_id'] = $this->integer('opposing');
$return['notes'] = $this->string('notes');
$return['direction'] = $parts[1];

View File

@@ -313,16 +313,16 @@ class RecurrenceFormRequest extends FormRequest
default:
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type')));
case 'withdrawal':
$sourceId = (int)$data['source_id'];
$destinationId = (int)$data['withdrawal_destination_id'];
$sourceId = (int) $data['source_id'];
$destinationId = (int) $data['withdrawal_destination_id'];
break;
case 'deposit':
$sourceId = (int)$data['deposit_source_id'];
$destinationId = (int)$data['destination_id'];
$sourceId = (int) $data['deposit_source_id'];
$destinationId = (int) $data['destination_id'];
break;
case 'transfer':
$sourceId = (int)$data['source_id'];
$destinationId = (int)$data['destination_id'];
$sourceId = (int) $data['source_id'];
$destinationId = (int) $data['destination_id'];
break;
}
// validate source account.
@@ -330,7 +330,7 @@ class RecurrenceFormRequest extends FormRequest
// do something with result:
if (false === $validSource) {
$message = (string)trans('validation.generic_invalid_source');
$message = (string) trans('validation.generic_invalid_source');
$validator->errors()->add('source_id', $message);
$validator->errors()->add('deposit_source_id', $message);
@@ -341,7 +341,7 @@ class RecurrenceFormRequest extends FormRequest
$validDestination = $accountValidator->validateDestination(['id' => $destinationId,]);
// do something with result:
if (false === $validDestination) {
$message = (string)trans('validation.generic_invalid_destination');
$message = (string) trans('validation.generic_invalid_destination');
$validator->errors()->add('destination_id', $message);
$validator->errors()->add('withdrawal_destination_id', $message);
}

View File

@@ -55,7 +55,7 @@ class ReportFormRequest extends FormRequest
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $accountId) {
$account = $repository->find((int)$accountId);
$account = $repository->find((int) $accountId);
if (null !== $account) {
$collection->push($account);
}
@@ -78,7 +78,7 @@ class ReportFormRequest extends FormRequest
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $budgetId) {
$budget = $repository->find((int)$budgetId);
$budget = $repository->find((int) $budgetId);
if (null !== $budget) {
$collection->push($budget);
}
@@ -101,7 +101,7 @@ class ReportFormRequest extends FormRequest
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $categoryId) {
$category = $repository->find((int)$categoryId);
$category = $repository->find((int) $categoryId);
if (null !== $category) {
$collection->push($category);
}
@@ -124,7 +124,7 @@ class ReportFormRequest extends FormRequest
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $accountId) {
$account = $repository->find((int)$accountId);
$account = $repository->find((int) $accountId);
if (null !== $account) {
$collection->push($account);
}
@@ -145,7 +145,7 @@ class ReportFormRequest extends FormRequest
{
$date = today(config('app.timezone'));
$range = $this->get('daterange');
$parts = explode(' - ', (string)$range);
$parts = explode(' - ', (string) $range);
if (2 === count($parts)) {
$string = $parts[1];
// validate as date
@@ -179,7 +179,7 @@ class ReportFormRequest extends FormRequest
{
$date = today(config('app.timezone'));
$range = $this->get('daterange');
$parts = explode(' - ', (string)$range);
$parts = explode(' - ', (string) $range);
if (2 === count($parts)) {
$string = $parts[0];
// validate as date
@@ -223,7 +223,7 @@ class ReportFormRequest extends FormRequest
$collection->push($tag);
continue;
}
$tag = $repository->find((int)$tagTag);
$tag = $repository->find((int) $tagTag);
if (null !== $tag) {
$collection->push($tag);
}

View File

@@ -69,7 +69,7 @@ class RuleFormRequest extends FormRequest
$return[] = [
'type' => $trigger['type'] ?? 'invalid',
'value' => $trigger['value'] ?? '',
'stop_processing' => 1 === (int)$stopProcessing,
'stop_processing' => 1 === (int) $stopProcessing,
];
}
}
@@ -90,7 +90,7 @@ class RuleFormRequest extends FormRequest
$return[] = [
'type' => $action['type'] ?? 'invalid',
'value' => $action['value'] ?? '',
'stop_processing' => 1 === (int)$stopProcessing,
'stop_processing' => 1 === (int) $stopProcessing,
];
}
}