Release 2.9.0 (#4526)

* added fix to work around bc break in new phpword version
* fix phpoffice deprecations
* mark unused option as deprecated
* support for DateTimeInterface and DateTimeImmutable where possible
* use TRUSTED_PROXIES setting - fixes #4533
* re-enable Kimai test in docker test build script (#4541)
* bump dependencies
This commit is contained in:
Kevin Papst
2024-01-10 12:43:07 +01:00
committed by GitHub
parent c6a651456e
commit 6531e7fe52
46 changed files with 487 additions and 485 deletions

View File

@@ -58,8 +58,10 @@ final class TimesheetBudgetUsedValidator extends ConstraintValidator
return;
}
$begin = $timesheet->getBegin();
// we can only work with stopped entries
if (null === $timesheet->getEnd() || null === $timesheet->getUser()) {
if ($begin === null || $timesheet->getEnd() === null || $timesheet->getUser() === null) {
return;
}
@@ -115,7 +117,7 @@ final class TimesheetBudgetUsedValidator extends ConstraintValidator
if ($duration === $rawData['duration'] &&
$rate === $rawData['rate'] &&
$timesheet->isBillable() === $rawData['billable'] &&
$timesheet->getBegin()->format('Y.m.d') === $rawData['begin']->format('Y.m.d') &&
$begin->format('Y.m.d') === $rawData['begin']->format('Y.m.d') &&
$timesheet->getProject()->getId() === $projectId &&
($timesheet->getActivity() === null || $timesheet->getActivity()->getId() === $activityId)
) {
@@ -145,11 +147,11 @@ final class TimesheetBudgetUsedValidator extends ConstraintValidator
}
}
$monthWasChanged = $timesheet->getBegin()->format('Y.m') !== $rawData['begin']->format('Y.m');
$monthWasChanged = $begin->format('Y.m') !== $rawData['begin']->format('Y.m');
}
$now = new DateTime('now', $timesheet->getBegin()->getTimezone());
$recordDate = $timesheet->getBegin();
$now = new DateTime('now', $begin->getTimezone());
$recordDate = $begin;
if (null !== ($activity = $timesheet->getActivity()) && $activity->hasBudgets()) {
$dateTime = $activity->isMonthlyBudget() ? $recordDate : $now;

View File

@@ -52,7 +52,7 @@ final class TimesheetLockdownValidator extends ConstraintValidator
$now = new \DateTime('now', $timesheetStart->getTimezone());
if (!empty($constraint->now)) {
if ($constraint->now instanceof \DateTime) {
if ($constraint->now instanceof \DateTimeInterface) {
$now = $constraint->now;
} elseif (\is_string($constraint->now)) {
try {