From 452c14bececfe4e424e63e2d2b705734454f324a Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 5 Jan 2017 08:47:09 +0100 Subject: [PATCH] Refactor method to original name #524 --- app/Http/Controllers/CategoryController.php | 2 +- app/Http/Controllers/Chart/CategoryController.php | 4 ++-- app/Repositories/Category/CategoryRepository.php | 2 +- app/Repositories/Category/CategoryRepositoryInterface.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 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.php index 8d7c04c7fe..15c807412f 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -91,7 +91,7 @@ class CategoryController extends Controller while ($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 Controller while ($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.php index 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.php index 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