Small code cleanup.

This commit is contained in:
James Cole
2023-12-23 06:22:47 +01:00
parent 581e5d7330
commit ca8f153c6a
7 changed files with 83 additions and 51 deletions

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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) {

View File

@@ -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
*/

View File

@@ -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
{