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

@@ -186,7 +186,7 @@ abstract class AbstractSpreadsheetRenderer
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), $excelDate);
// TODO why is that format hardcoded and does not depend on the users locale?
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD2);
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD);
}
protected function setDurationTotal(Worksheet $sheet, int $column, int $row, string $startCoordinate, string $endCoordinate): void

View File

@@ -24,11 +24,11 @@ final class DateFormatter implements CellFormatterInterface
return;
}
if (!$value instanceof \DateTime) {
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
if (!$value instanceof \DateTimeInterface) {
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
}
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));
$sheet->getStyleByColumnAndRow($column, $row)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD2);
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD);
}
}

View File

@@ -25,11 +25,11 @@ final class DateTimeFormatter implements CellFormatterInterface
return;
}
if (!$value instanceof \DateTime) {
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
if (!$value instanceof \DateTimeInterface) {
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
}
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));
$sheet->getStyleByColumnAndRow($column, $row)->getNumberFormat()->setFormatCode(self::DATETIME_FORMAT);
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(self::DATETIME_FORMAT);
}
}

View File

@@ -25,8 +25,8 @@ final class TimeFormatter implements CellFormatterInterface
return;
}
if (!$value instanceof \DateTime) {
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
if (!$value instanceof \DateTimeInterface) {
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
}
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));