Do loop instead of while loop [skip ci]

This commit is contained in:
James Cole
2016-10-21 06:41:33 +02:00
parent 97c0fb389d
commit fcdb6fd2a7

View File

@@ -556,13 +556,13 @@ class BillRepository implements BillRepositoryInterface
} }
// find the most recent date for this bill NOT in the future. Cache this date: // find the most recent date for this bill NOT in the future. Cache this date:
$start = clone $bill->date; $start = clone $bill->date;
Log::debug('Start is ' . $start->format('Y-m-d')); Log::debug('nextExpectedMatch: Start is ' . $start->format('Y-m-d'));
// do loop instead of while loop:
while ($start <= $date) { do {
$start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip); $start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
Log::debug('Start is now ' . $start->format('Y-m-d')); Log::debug('Start is now ' . $start->format('Y-m-d'));
} } while ($start <= $date);
$end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip); $end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
Log::debug('Final start is ' . $start->format('Y-m-d')); Log::debug('Final start is ' . $start->format('Y-m-d'));