Skip to content

Commit cdb152c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/php83-support
# Conflicts: # composer.lock
2 parents 4862822 + 299fb57 commit cdb152c

8 files changed

Lines changed: 1135 additions & 1126 deletions

File tree

Classes/Service/CellService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ private function formatString(mixed $value, Cell $cell): string
126126
setlocale(LC_NUMERIC, $currentLocale);
127127
}
128128

129-
return (string)$value;
129+
return $value;
130130
}
131131

132-
return (string)NumberFormat::toFormattedString($value, NumberFormat::FORMAT_GENERAL);
132+
/** @var bool|float|int|RichText|string|null $value */
133+
return NumberFormat::toFormattedString($value, NumberFormat::FORMAT_GENERAL);
133134
}
134135
}

Classes/Service/SpanService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function getMergedCells(Worksheet $worksheet): array
150150
}
151151

152152
/**
153-
* @param array<array<int>|CellAddress|string> $references
153+
* @param array<array{0: int, 1: int}|CellAddress|string> $references
154154
* @return array<int>
155155
*/
156156
private function getCellStyleIndexesFromReferences(Worksheet $worksheet, array $references): array

Tests/Unit/DataProcessing/SpreadsheetProcessorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static function processingDataProvider(): array
155155
'firstColumnIsHeader' => false,
156156
],
157157
],
158-
'alternativeExpectation' => self::validInputExpectationsOnlyWithBody(...),
158+
'alternativeExpectations' => self::validInputExpectationsOnlyWithBody(...),
159159
],
160160
'left head data is set because we do not have extracted head data' => [
161161
'processConfig' => ['value' => 'file:123|2!A1:B2'],
@@ -173,7 +173,7 @@ public static function processingDataProvider(): array
173173
'firstColumnIsHeader' => true,
174174
],
175175
],
176-
'alternativeExpectation' => self::validInputExpectationsOnlyWithBody(...),
176+
'alternativeExpectations' => self::validInputExpectationsOnlyWithBody(...),
177177
],
178178
'head and foot data are not filled incorrectly when no data is given' => [
179179
'processConfig' => ['value' => 'file:123|2!A1:B2'],
@@ -187,7 +187,7 @@ public static function processingDataProvider(): array
187187
'firstColumnIsHeader' => false,
188188
],
189189
],
190-
'alternativeExpectation' => self::validInputExpectationsWithEmptyBody(...),
190+
'alternativeExpectations' => self::validInputExpectationsWithEmptyBody(...),
191191
],
192192
];
193193
}

Tests/Unit/DataProcessing/TabsProcessorTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ protected function getDataProcessor(): AbstractProcessor
2929
protected function validInputExpectations(MockObject $spreadsheetMock): void
3030
{
3131
// mock worksheet will be returned
32-
$worksheetMock = $this->createConfiguredMock(
33-
Worksheet::class,
34-
[
35-
'getTitle' => 'Worksheet #1',
36-
'getHashCode' => '263df821f3760dc1ec4e',
37-
]
38-
);
32+
$worksheetMock = new Worksheet(null, 'Worksheet #1');
3933
$spreadsheetMock->expects(self::once())->method('getAllSheets')->willReturn([$worksheetMock]);
4034

4135
// check if extract gets called
@@ -80,7 +74,7 @@ public static function processingDataProvider(): array
8074
'expectedResult' => [
8175
'someOtherVar' => [
8276
// key is file uid and hash code
83-
'123263df821f3760dc1ec4e' => [
77+
'123b8367b83d9b7fa3124b32922f50ad2fc' => [
8478
'sheetTitle' => 'Worksheet #1',
8579
'bodyData' => ['body-data-mocked'],
8680
'headData' => ['head-data-mocked'],
@@ -97,7 +91,7 @@ public static function processingDataProvider(): array
9791
'expectedResult' => [
9892
'spreadsheets' => [
9993
// key is file uid and hash code
100-
'123263df821f3760dc1ec4e' => [
94+
'123b8367b83d9b7fa3124b32922f50ad2fc' => [
10195
'sheetTitle' => 'Worksheet #1',
10296
'bodyData' => ['body-data-mocked'],
10397
'headData' => ['head-data-mocked'],

Tests/Unit/Service/CellServiceTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ public function testCatchingOfCalculatedCellValues(): void
112112
$mockedCell->method('getValue')->willReturn('MockValue');
113113

114114
// build chain for style index search
115-
$worksheetMock = $this->getMockBuilder(Worksheet::class)->disableOriginalConstructor()->getMock();
116-
$worksheetMock->method('getParent')->willReturn($this->spreadsheet);
117-
115+
$worksheetMock = new Worksheet($this->spreadsheet, 'Worksheet');
118116
$mockedCell->method('getWorksheet')->willReturn($worksheetMock);
119117

120118
self::assertEquals('MockValue', $this->cellService->getFormattedValue($mockedCell));

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
2222
"ext-json": "*",
2323
"ext-mbstring": "*",
24-
"phpoffice/phpspreadsheet": "^1.29",
24+
"phpoffice/phpspreadsheet": "^1.29 || ^2.0",
2525
"typo3/cms-backend": "^11.5 || ^12.4",
2626
"typo3/cms-core": "^11.5 || ^12.4",
2727
"typo3/cms-extbase": "^11.5 || ^12.4",

0 commit comments

Comments
 (0)