mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Specify return types.
This commit is contained in:
@@ -50,7 +50,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function allAccounts(AccountRepositoryInterface $repository)
|
||||
public function allAccounts(AccountRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$return = array_unique(
|
||||
$repository->getAccountsByType(
|
||||
@@ -98,7 +98,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function budgets(BudgetRepositoryInterface $repository)
|
||||
public function budgets(BudgetRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$return = array_unique($repository->getBudgets()->pluck('name')->toArray());
|
||||
sort($return);
|
||||
@@ -113,7 +113,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function categories(CategoryRepositoryInterface $repository)
|
||||
public function categories(CategoryRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$return = array_unique($repository->getCategories()->pluck('name')->toArray());
|
||||
sort($return);
|
||||
@@ -126,7 +126,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function currencyNames(CurrencyRepositoryInterface $repository)
|
||||
public function currencyNames(CurrencyRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$return = $repository->get()->pluck('name')->toArray();
|
||||
sort($return);
|
||||
@@ -141,7 +141,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function expenseAccounts(AccountRepositoryInterface $repository)
|
||||
public function expenseAccounts(AccountRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$set = $repository->getAccountsByType([AccountType::EXPENSE, AccountType::BENEFICIARY]);
|
||||
$filtered = $set->filter(
|
||||
@@ -199,7 +199,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function revenueAccounts(AccountRepositoryInterface $repository)
|
||||
public function revenueAccounts(AccountRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$set = $repository->getAccountsByType([AccountType::REVENUE]);
|
||||
$filtered = $set->filter(
|
||||
@@ -224,7 +224,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function tags(TagRepositoryInterface $tagRepository)
|
||||
public function tags(TagRepositoryInterface $tagRepository): JsonResponse
|
||||
{
|
||||
$return = array_unique($tagRepository->get()->pluck('tag')->toArray());
|
||||
sort($return);
|
||||
@@ -238,7 +238,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function transactionJournals(JournalCollectorInterface $collector, string $what)
|
||||
public function transactionJournals(JournalCollectorInterface $collector, string $what): JsonResponse
|
||||
{
|
||||
$type = config('firefly.transactionTypesByWhat.' . $what);
|
||||
$types = [$type];
|
||||
@@ -255,7 +255,7 @@ class AutoCompleteController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function transactionTypes(JournalRepositoryInterface $repository)
|
||||
public function transactionTypes(JournalRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
$return = array_unique($repository->getTransactionTypes()->pluck('type')->toArray());
|
||||
sort($return);
|
||||
|
Reference in New Issue
Block a user