Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Refactor method to original name #524
James Cole452c14bececf
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.phpindex 44d25e47f1..cf1404f0dd 100644--- a/app/Http/Controllers/CategoryController.php+++ b/app/Http/Controllers/CategoryController.php@@ -346,7 +346,7 @@ class CategoryController extends Controller$end = Navigation::startOfPeriod($end, $range);$currentEnd = Navigation::endOfPeriod($end, $range);$spent = $repository->spentInPeriodCollector(new Collection([$category]), $accounts, $end, $currentEnd);- $earned = $repository->earnedInPeriodCollector(new Collection([$category]), $accounts, $end, $currentEnd);+ $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $end, $currentEnd);$dateStr = $end->format('Y-m-d');$dateName = Navigation::periodShow($end, $range);$entries->push([$dateStr, $dateName, $spent, $earned]);diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.phpindex 8d7c04c7fe..15c807412f 100644--- a/app/Http/Controllers/Chart/CategoryController.php+++ b/app/Http/Controllers/Chart/CategoryController.php@@ -91,7 +91,7 @@ class CategoryController extends Controllerwhile ($start <= $end) {$currentEnd = Navigation::endOfPeriod($start, $range);$spent = $repository->spentInPeriodCollector(new Collection([$category]), $accounts, $start, $currentEnd);- $earned = $repository->earnedInPeriodCollector(new Collection([$category]), $accounts, $start, $currentEnd);+ $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $start, $currentEnd);$label = Navigation::periodShow($start, $range);$chartData[0]['entries'][$label] = bcmul($spent, '-1');$chartData[1]['entries'][$label] = $earned;@@ -316,7 +316,7 @@ class CategoryController extends Controllerwhile ($start <= $end) {$spent = $repository->spentInPeriodCollector(new Collection([$category]), $accounts, $start, $start);- $earned = $repository->earnedInPeriodCollector(new Collection([$category]), $accounts, $start, $start);+ $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $start, $start);$label = Navigation::periodShow($start, '1D');$chartData[0]['entries'][$label] = bcmul($spent, '-1');diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.phpindex 90ccc0a30a..8d4d7ed1ec 100644--- a/app/Repositories/Category/CategoryRepository.php+++ b/app/Repositories/Category/CategoryRepository.php@@ -64,7 +64,7 @@ class CategoryRepository implements CategoryRepositoryInterface** @return string*/- public function earnedInPeriodCollector(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string+ public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string{/** @var JournalCollectorInterface $collector */$collector = app(JournalCollectorInterface::class, [$this->user]);diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.phpindex 61f4810f3a..66bfe14a19 100644--- a/app/Repositories/Category/CategoryRepositoryInterface.php+++ b/app/Repositories/Category/CategoryRepositoryInterface.php@@ -39,7 +39,7 @@ interface CategoryRepositoryInterface** @return string*/- public function earnedInPeriodCollector(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string;+ public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string;/*** Find a category