Skip to content

Commit

Permalink
Merge pull request #569 from hoogi91/develop
Browse files Browse the repository at this point in the history
Bugfix Release 4.0.1
  • Loading branch information
hoogi91 authored Jul 21, 2024
2 parents 14d06b5 + ac43aad commit 825aa60
Show file tree
Hide file tree
Showing 23 changed files with 3,498 additions and 3,396 deletions.
40 changes: 0 additions & 40 deletions .devcontainer/devcontainer.json

This file was deleted.

18 changes: 0 additions & 18 deletions .devcontainer/postCreate.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
dependencies:
- "locked"
php-version:
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Composer install"
uses: ./.github/actions/composer
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- uses: tomasnorre/typo3-upload-ter@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Composer install"
uses: ./.github/actions/npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
dependencies:
- "locked"
php-version:
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Composer install"
uses: ./.github/actions/composer
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- "lowest"
- "highest"
php-version:
- "8.3"
- "8.2"
- "8.1"
operating-system:
Expand All @@ -32,7 +33,7 @@ jobs:
- "false"
include:
- dependencies: "locked"
php-version: "8.2"
php-version: "8.3"
operating-system: "ubuntu-latest"
coverage: "true"

Expand All @@ -50,7 +51,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Composer install"
uses: ./.github/actions/composer
Expand All @@ -66,7 +67,7 @@ jobs:
coverage-folder: ./coverage/

- name: "Upload coverage"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: matrix.coverage == 'true'
with:
token: '${{ secrets.CODECOV_TOKEN }}'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
dependencies:
- "locked"
php-version:
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Composer install"
uses: ./.github/actions/composer
Expand All @@ -36,6 +36,6 @@ jobs:
run: .Build/bin/psalm --output-format=github --report=results.sarif

- name: "Upload Security Analysis results to GitHub"
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion Classes/Form/Element/DataInputElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(NodeFactory $nodeFactory, array $data)

$this->view = GeneralUtility::makeInstance(StandaloneView::class);
$this->view->setTemplatePathAndFilename($this->getTemplatePath());
$this->view->assign('inputSize', (int)$this->config['size'] ?: 0);
$this->view->assign('inputSize', (int)($this->config['size'] ?? 0));
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Classes/Service/CellService.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ private function formatString(mixed $value, Cell $cell): string
setlocale(LC_NUMERIC, $currentLocale);
}

return (string)$value;
return $value;
}

return (string)NumberFormat::toFormattedString($value, NumberFormat::FORMAT_GENERAL);
/** @var bool|float|int|RichText|string|null $value */
return NumberFormat::toFormattedString($value, NumberFormat::FORMAT_GENERAL);
}
}
2 changes: 1 addition & 1 deletion Classes/Service/SpanService.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getMergedCells(Worksheet $worksheet): array
}

/**
* @param array<array<int>|CellAddress|string> $references
* @param array<array{0: int, 1: int}|CellAddress|string> $references
* @return array<int>
*/
private function getCellStyleIndexesFromReferences(Worksheet $worksheet, array $references): array
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ project = Spreadsheets
# ... (recommended) version, displayed next to title (desktop) and in <meta name="book-version"
# .................................................................................

release = 4.0.0
release = 4.0.1

# .................................................................................
# ... (recommended) displayed in footer
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# TYPO3 Extension ``spreadsheets``

[![Version](https://img.shields.io/github/v/tag/hoogi91/spreadsheets?label=stable&style=for-the-badge)](https://packagist.org/packages/hoogi91/spreadsheets)
[![Version](https://img.shields.io/github/v/tag/hoogi91/spreadsheets?sort=semver&label=stable&style=for-the-badge)](https://packagist.org/packages/hoogi91/spreadsheets)
[![Tests](https://img.shields.io/github/actions/workflow/status/hoogi91/spreadsheets/phpunit.yml?label=tests&style=for-the-badge)](https://github.com/hoogi91/spreadsheets/actions/workflows/phpunit.yml)
[![Coverage](https://img.shields.io/codecov/c/github/hoogi91/spreadsheets?style=for-the-badge)](https://codecov.io/gh/hoogi91/spreadsheets)
[![License](https://img.shields.io/github/license/hoogi91/spreadsheets?style=for-the-badge)](https://github.com/hoogi91/spreadsheets/blob/develop/LICENSE)
[![Documentation](https://img.shields.io/github/v/tag/hoogi91/spreadsheets?color=ffe907&label=docs&style=for-the-badge)](https://docs.typo3.org/p/hoogi91/spreadsheets/main/en-us/)
[![Documentation](https://img.shields.io/github/v/tag/hoogi91/spreadsheets?sort=semver&color=ffe907&label=docs&style=for-the-badge)](https://docs.typo3.org/p/hoogi91/spreadsheets/main/en-us/)

> composer req hoogi91/spreadsheets
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Spreadsheets | TYPO3 | PHP | Supported |
| ------------ | ----------- |-----------|-------------------------------|
| dev-master | 12.4 | 8.2 | :white_check_mark: (unstable) |
| 4.x | 11.5 - 12.4 | 8.1 - 8.2 | :white_check_mark: |
| dev-master | 12.4 | 8.3 | :white_check_mark: (unstable) |
| 4.x | 11.5 - 12.4 | 8.1 - 8.3 | :white_check_mark: |
| 3.x | 10.4 - 11.5 | 7.3 - 8.1 | :white_check_mark: (security) |
| 2.x | 10.4 | 7.2 - 7.4 | :x: |
| 1.x | 8.7 - 9.5 | 7.0 - 7.2 | :x: |
Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/01_fixture.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.cell.cell-style-10 {vertical-align:bottom;border-bottom:2px solid #000000 !important;color:#000000;font-weight:bold}
.cell.cell-style-11 {vertical-align:bottom;border-bottom:2px solid #000000 !important;color:#000000;font-weight:bold}
.cell.cell-style-12 {vertical-align:bottom;border-bottom:2px solid #000000 !important;border-right:2px solid #000000 !important;color:#000000;font-weight:bold}
.cell.cell-style-13 {vertical-align:bottom;color:#335593;font-weight:bold;font-style:italic;text-decoration:underline}
.cell.cell-style-13 {vertical-align:bottom;color:#2F5396;font-weight:bold;font-style:italic;text-decoration:underline}
.cell.cell-style-14 {vertical-align:bottom;color:#000000}
.cell.cell-style-15 {vertical-align:bottom;color:#000000}
.cell.cell-style-16 {vertical-align:bottom;color:#0563C1;text-decoration:underline}
Expand Down
6 changes: 3 additions & 3 deletions Tests/Unit/DataProcessing/SpreadsheetProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static function processingDataProvider(): array
'firstColumnIsHeader' => false,
],
],
'alternativeExpectation' => self::validInputExpectationsOnlyWithBody(...),
'alternativeExpectations' => self::validInputExpectationsOnlyWithBody(...),
],
'left head data is set because we do not have extracted head data' => [
'processConfig' => ['value' => 'file:123|2!A1:B2'],
Expand All @@ -173,7 +173,7 @@ public static function processingDataProvider(): array
'firstColumnIsHeader' => true,
],
],
'alternativeExpectation' => self::validInputExpectationsOnlyWithBody(...),
'alternativeExpectations' => self::validInputExpectationsOnlyWithBody(...),
],
'head and foot data are not filled incorrectly when no data is given' => [
'processConfig' => ['value' => 'file:123|2!A1:B2'],
Expand All @@ -187,7 +187,7 @@ public static function processingDataProvider(): array
'firstColumnIsHeader' => false,
],
],
'alternativeExpectation' => self::validInputExpectationsWithEmptyBody(...),
'alternativeExpectations' => self::validInputExpectationsWithEmptyBody(...),
],
];
}
Expand Down
12 changes: 3 additions & 9 deletions Tests/Unit/DataProcessing/TabsProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ protected function getDataProcessor(): AbstractProcessor
protected function validInputExpectations(MockObject $spreadsheetMock): void
{
// mock worksheet will be returned
$worksheetMock = $this->createConfiguredMock(
Worksheet::class,
[
'getTitle' => 'Worksheet #1',
'getHashCode' => '263df821f3760dc1ec4e',
]
);
$worksheetMock = new Worksheet(null, 'Worksheet #1');
$spreadsheetMock->expects(self::once())->method('getAllSheets')->willReturn([$worksheetMock]);

// check if extract gets called
Expand Down Expand Up @@ -80,7 +74,7 @@ public static function processingDataProvider(): array
'expectedResult' => [
'someOtherVar' => [
// key is file uid and hash code
'123263df821f3760dc1ec4e' => [
'123b8367b83d9b7fa3124b32922f50ad2fc' => [
'sheetTitle' => 'Worksheet #1',
'bodyData' => ['body-data-mocked'],
'headData' => ['head-data-mocked'],
Expand All @@ -97,7 +91,7 @@ public static function processingDataProvider(): array
'expectedResult' => [
'spreadsheets' => [
// key is file uid and hash code
'123263df821f3760dc1ec4e' => [
'123b8367b83d9b7fa3124b32922f50ad2fc' => [
'sheetTitle' => 'Worksheet #1',
'bodyData' => ['body-data-mocked'],
'headData' => ['head-data-mocked'],
Expand Down
4 changes: 1 addition & 3 deletions Tests/Unit/Service/CellServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ public function testCatchingOfCalculatedCellValues(): void
$mockedCell->method('getValue')->willReturn('MockValue');

// build chain for style index search
$worksheetMock = $this->getMockBuilder(Worksheet::class)->disableOriginalConstructor()->getMock();
$worksheetMock->method('getParent')->willReturn($this->spreadsheet);

$worksheetMock = new Worksheet($this->spreadsheet, 'Worksheet');
$mockedCell->method('getWorksheet')->willReturn($worksheetMock);

self::assertEquals('MockValue', $this->cellService->getFormattedValue($mockedCell));
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-json": "*",
"ext-mbstring": "*",
"phpoffice/phpspreadsheet": "^1.23",
"phpoffice/phpspreadsheet": "^1.29 || ^2.0",
"typo3/cms-backend": "^11.5 || ^12.4",
"typo3/cms-core": "^11.5 || ^12.4",
"typo3/cms-extbase": "^11.5 || ^12.4",
Expand All @@ -35,7 +35,7 @@
"helhum/typo3-console": "^7.1 || ^8.0",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5 || ^10.0",
"rector/rector": "^0.15 || ^0.16 || ^0.17",
"rector/rector": "^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^1.0",
"roave/security-advisories": "dev-latest",
"slevomat/coding-standard": "^8.8",
"squizlabs/php_codesniffer": "^3.5",
Expand Down Expand Up @@ -67,7 +67,7 @@
"extension-spreadsheet-fallback": [
"mkdir -p Resources/Private/Composer",
"if [ -f Resources/Private/Composer/composer.json ]; then cd Resources/Private/Composer/ && composer update; fi",
"if [ ! -f Resources/Private/Composer/composer.json ]; then cd Resources/Private/Composer/ && composer require phpoffice/phpspreadsheet=^1.23 --ignore-platform-reqs && composer config classmap-authoritative true && composer config prepend-autoloader true && composer dump-autoload -o; fi"
"if [ ! -f Resources/Private/Composer/composer.json ]; then cd Resources/Private/Composer/ && composer require phpoffice/phpspreadsheet=^1.29 --ignore-platform-reqs && composer config classmap-authoritative true && composer config prepend-autoloader true && composer dump-autoload -o; fi"
],
"prepare-release": [
"@extension-spreadsheet-fallback",
Expand Down
Loading

0 comments on commit 825aa60

Please sign in to comment.