From 1bcc975d7b43a15a4f101254b876f15ca9559701 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 18 Feb 2016 06:15:01 +0100 Subject: [PATCH] Some new phpDoc and refactoring. --- app/Http/Controllers/Chart/CategoryController.php | 2 ++ app/Rules/TransactionMatcher.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 84cf3c1fed..409d20a21a 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -375,6 +375,8 @@ class CategoryController extends Controller } /** + * Not the most elegant solution but it works. + * * @param Collection $entries * * @return Collection diff --git a/app/Rules/TransactionMatcher.php b/app/Rules/TransactionMatcher.php index dbfbabdbcd..521ca38539 100644 --- a/app/Rules/TransactionMatcher.php +++ b/app/Rules/TransactionMatcher.php @@ -74,10 +74,10 @@ class TransactionMatcher $processed += count($set); // Check for conditions to finish the loop - $reachedEndOfList = (count($set) < $pagesize); - $foundEnoughTransactions = (count($result) >= $this->limit); - $searchedEnoughTransactions = ($processed >= $this->range); - } while (!$reachedEndOfList && !$foundEnoughTransactions && !$searchedEnoughTransactions); + $reachedEndOfList = $set->count() < $pagesize; + $foundEnough = $result->count() >= $this->limit; + $searchedEnough = ($processed >= $this->range); + } while (!$reachedEndOfList && !$foundEnough && !$searchedEnough); // If the list of matchingTransactions is larger than the maximum number of results // (e.g. if a large percentage of the transactions match), truncate the list