Skip to content

Commit bed190b

Browse files
bug: #196 support php7.1
1 parent 47aebd6 commit bed190b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ public function apply($element)
3131
return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getEndDate(), $options);
3232
}
3333

34-
return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getRecurrences(), $options);
34+
if (PHP_VERSION_ID >= 70217) {
35+
$recurrences = $element->getRecurrences();
36+
} else {
37+
$recurrences = $element->recurrences - $element->include_start_date;
38+
}
39+
40+
return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $recurrences, $options);
3541
}
3642
}

0 commit comments

Comments
 (0)