Some new phpDoc and refactoring.

This commit is contained in:
James Cole
2016-02-18 06:15:01 +01:00
parent 98fd5b8858
commit 1bcc975d7b
2 changed files with 6 additions and 4 deletions

View File

@@ -375,6 +375,8 @@ class CategoryController extends Controller
} }
/** /**
* Not the most elegant solution but it works.
*
* @param Collection $entries * @param Collection $entries
* *
* @return Collection * @return Collection

View File

@@ -74,10 +74,10 @@ class TransactionMatcher
$processed += count($set); $processed += count($set);
// Check for conditions to finish the loop // Check for conditions to finish the loop
$reachedEndOfList = (count($set) < $pagesize); $reachedEndOfList = $set->count() < $pagesize;
$foundEnoughTransactions = (count($result) >= $this->limit); $foundEnough = $result->count() >= $this->limit;
$searchedEnoughTransactions = ($processed >= $this->range); $searchedEnough = ($processed >= $this->range);
} while (!$reachedEndOfList && !$foundEnoughTransactions && !$searchedEnoughTransactions); } while (!$reachedEndOfList && !$foundEnough && !$searchedEnough);
// If the list of matchingTransactions is larger than the maximum number of results // 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 // (e.g. if a large percentage of the transactions match), truncate the list