mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Small code cleanup.
This commit is contained in:
@@ -82,7 +82,7 @@ class TransactionController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params <array<string, array<string, int|string>>>
|
||||
* @param array<string, array<string, string>> $params
|
||||
*/
|
||||
private function isUpdateTransactionAccount(array $params): bool
|
||||
{
|
||||
|
@@ -161,7 +161,7 @@ class DestroyController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $types <int, string>
|
||||
* @param array<int, string> $types
|
||||
*/
|
||||
private function destroyAccounts(array $types): void
|
||||
{
|
||||
@@ -187,7 +187,7 @@ class DestroyController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $types <int, string>
|
||||
* @param array<int, string> $types
|
||||
*/
|
||||
private function destroyTransactions(array $types): void
|
||||
{
|
||||
|
@@ -243,6 +243,9 @@ class UpdateRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* For each field, add it to the array if a reference is present in the request:
|
||||
*
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getIntegerData(array $current, array $transaction): array
|
||||
{
|
||||
@@ -255,6 +258,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getStringData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->stringFields as $fieldName) {
|
||||
@@ -266,6 +273,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getNlStringData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->textareaFields as $fieldName) {
|
||||
@@ -277,6 +288,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getDateData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->dateFields as $fieldName) {
|
||||
@@ -290,6 +305,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getBooleanData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->booleanFields as $fieldName) {
|
||||
@@ -301,6 +320,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getArrayData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->arrayFields as $fieldName) {
|
||||
@@ -312,6 +335,10 @@ class UpdateRequest extends FormRequest
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $current
|
||||
* @param array<string, mixed> $transaction
|
||||
*/
|
||||
private function getFloatData(array $current, array $transaction): array
|
||||
{
|
||||
foreach ($this->floatFields as $fieldName) {
|
||||
|
@@ -169,9 +169,9 @@ class BudgetController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Shared between the "noBudgetLimits" function and "processLimit".
|
||||
* Shared between the "noBudgetLimits" function and "processLimit". Will take a single set of expenses and return its info.
|
||||
*
|
||||
* Will take a single set of expenses and return its info.
|
||||
* @param array<int, array<int, string>> $array
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
|
@@ -88,7 +88,7 @@ class Controller extends BaseController
|
||||
/**
|
||||
* Returns a JSON API object and returns it.
|
||||
*
|
||||
* @param Model $object
|
||||
* @param array<int, mixed>|Model $object
|
||||
*/
|
||||
final protected function jsonApiObject(string $key, array|Model $object, AbstractTransformer $transformer): array
|
||||
{
|
||||
|
Reference in New Issue
Block a user