Skip to content

Commit 2656cce

Browse files
Kocenjeck
authored andcommitted
chore(deps): update dependency phpoffice/phpspreadsheet to 5.1
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent dd2055a commit 2656cce

3 files changed

Lines changed: 17 additions & 77 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
]
5050
},
5151
"require": {
52-
"phpoffice/phpspreadsheet": "^1.29.12",
52+
"phpoffice/phpspreadsheet": "^5.1",
5353
"ext-json": "*"
5454
}
5555
}

composer.lock

Lines changed: 13 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Service/ImportService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ private function upsertRow(Row $row): void {
465465
} elseif ($column->getType() === Column::TYPE_SELECTION
466466
&& $column->getSubtype() === Column::SUBTYPE_SELECTION_CHECK
467467
) {
468-
$value = $cell->getFormattedValue() === 'TRUE' ? 'true' : 'false';
468+
$value = in_array($cell->getFormattedValue(), ['TRUE', '1'], true) ? 'true' : 'false';
469469
}
470470

471471
$data[] = [
@@ -513,6 +513,7 @@ private function valueToDateTimeImmutable(mixed $value): ?DateTimeImmutable {
513513
}
514514
try {
515515
$dt = Date::excelToDateTimeObject($value);
516+
Date::roundMicroseconds($dt);
516517
return DateTimeImmutable::createFromMutable($dt);
517518
} catch (TypeError) {
518519
try {
@@ -702,7 +703,7 @@ private function parseColumnDataType(Cell $cell): array {
702703
}
703704
} elseif ($originDataType === DataType::TYPE_BOOL
704705
|| ($originDataType === DataType::TYPE_FORMULA
705-
&& in_array($formattedValue, ['FALSE', 'TRUE'], true))
706+
&& in_array($formattedValue, ['FALSE', 'TRUE', '', '1'], true))
706707
) {
707708
$dataType = [
708709
'type' => Column::TYPE_SELECTION,

0 commit comments

Comments
 (0)