N°7845 Suppress risky syntax with DateTime::modify (at best, just a bad example, at worst, just a result that will vary wether PHP > 8.2 or not)

This commit is contained in:
Romain Quetiez
2024-09-26 17:51:52 +02:00
parent 8e2a68887c
commit 380512dcbe
6 changed files with 117 additions and 42 deletions

View File

@@ -108,7 +108,7 @@ class DefaultWorkingTimeComputer implements iWorkingTimeComputer
// Default implementation: 24x7, no holidays: to compute the deadline, just add
// the specified duration to the given date/time
$oResult = clone $oStartDate;
$oResult->modify('+'.$iDuration.' seconds');
$oResult->modify($iDuration.' seconds');
if (class_exists('WorkingTimeRecorder'))
{
WorkingTimeRecorder::SetValues($oStartDate->format('U'), $oResult->format('U'), $iDuration, WorkingTimeRecorder::COMPUTED_END);