Refactor phpstan errors.

This commit is contained in:
James Cole
2023-10-29 17:41:14 +01:00
parent 5e32878d01
commit 12675dd950
60 changed files with 297 additions and 386 deletions

View File

@@ -38,8 +38,6 @@ use Illuminate\Http\JsonResponse;
*/
class ShowController extends Controller
{
use ConvertsExchangeRates;
private BudgetRepositoryInterface $repository;
/**
@@ -69,7 +67,6 @@ class ShowController extends Controller
{
$data = $request->getAll();
$result = $this->repository->budgetedInPeriodForBudget($budget, $data['start'], $data['end']);
//$converted = $this->cerSum(array_values($result));
return response()->json($result);
}
@@ -83,7 +80,6 @@ class ShowController extends Controller
{
$data = $request->getAll();
$result = $this->repository->spentInPeriodForBudget($budget, $data['start'], $data['end']);
// $converted = $this->cerSum(array_values($result));
return response()->json($result);
}

View File

@@ -36,8 +36,6 @@ use Illuminate\Http\JsonResponse;
*/
class SumController extends Controller
{
use ConvertsExchangeRates;
private BudgetRepositoryInterface $repository;
/**
@@ -65,12 +63,10 @@ class SumController extends Controller
*/
public function budgeted(DateRequest $request): JsonResponse
{
throw new FireflyException('Needs refactoring, uses deprecated method.');
$data = $request->getAll();
$result = $this->repository->budgetedInPeriod($data['start'], $data['end']);
$converted = $this->cerSum(array_values($result));
return response()->json($converted);
return response()->json($result);
}
/**
@@ -83,11 +79,9 @@ class SumController extends Controller
*/
public function spent(DateRequest $request): JsonResponse
{
throw new FireflyException('Needs refactoring, uses deprecated method.');
$data = $request->getAll();
$result = $this->repository->spentInPeriod($data['start'], $data['end']);
$converted = $this->cerSum(array_values($result));
return response()->json($converted);
return response()->json($result);
}
}