From fcdb6fd2a76cbc8b8c14f804f72e31491a5c9d4b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 21 Oct 2016 06:41:33 +0200 Subject: [PATCH] Do loop instead of while loop [skip ci] --- app/Repositories/Bill/BillRepository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 3757160ece..913e6990e3 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -556,13 +556,13 @@ class BillRepository implements BillRepositoryInterface } // find the most recent date for this bill NOT in the future. Cache this date: $start = clone $bill->date; - Log::debug('Start is ' . $start->format('Y-m-d')); + Log::debug('nextExpectedMatch: Start is ' . $start->format('Y-m-d')); - - while ($start <= $date) { + // do loop instead of while loop: + do { $start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip); Log::debug('Start is now ' . $start->format('Y-m-d')); - } + } while ($start <= $date); $end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip); Log::debug('Final start is ' . $start->format('Y-m-d'));