Skip to content

Commit 94117dd

Browse files
authored
Merge branch 'master' into visibility
2 parents 8e899d1 + 2e998d6 commit 94117dd

File tree

129 files changed

+1098
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1098
-616
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
'standardize_not_equals' => true,
222222
'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()`
223223
'strict_comparison' => false, // No, too dangerous to change that
224-
'string_implicit_backslashes' => false, // was escape_implicit_backslashes, too confusing
224+
'string_implicit_backslashes' => ['single_quoted' => 'unescape', 'double_quoted' => 'escape', 'heredoc' => 'escape'], // was escape_implicit_backslashes
225225
'strict_param' => false, // No, too dangerous to change that
226226
'string_length_to_empty' => true,
227227
'string_line_ending' => true,

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1818
### Changed
1919

2020
- ListWorksheetInfo will now return sheetState (visible, hidden, veryHidden). [Issue #4345](https://github.com/PHPOffice/PhpSpreadsheet/issues/4345) [PR #4366](https://github.com/PHPOffice/PhpSpreadsheet/pull/4366)
21+
- Start migration to Phpstan 2. [PR #4359](https://github.com/PHPOffice/PhpSpreadsheet/pull/4359)
22+
- IOFactory identify can return, and createReader and CreateWriter can accept, a class name rather than a file type. [Issue #4357](https://github.com/PHPOffice/PhpSpreadsheet/issues/4357) [PR #4361](https://github.com/PHPOffice/PhpSpreadsheet/pull/4361)
2123

2224
### Moved
2325

@@ -29,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2931

3032
### Fixed
3133

32-
- Nothing yet.
34+
- Refactor Helper/Html. [PR #4359](https://github.com/PHPOffice/PhpSpreadsheet/pull/4359)
3335

3436
## 2025-02-08 - 4.0.0
3537

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"platform": {
1616
"php" : "8.1.99"
1717
},
18+
"process-timeout": 600,
1819
"sort-packages": true,
1920
"allow-plugins": {
2021
"dealerdirect/phpcodesniffer-composer-installer": true

docs/topics/Looping the Loop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $inputFileName = __DIR__ . '/../Financial Sample.xlsx';
1616

1717
$reader = IOFactory::createReader($inputFileType);
1818
$spreadsheet = $reader->load($inputFileName);
19-
19+
$worksheet = $spreadsheet->getActiveSheet();
2020

2121
$dataArray = $worksheet->toArray();
2222

docs/topics/reading-files.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ method to identify the reader that you need, before using the
123123
```php
124124
$inputFileName = './sampleData/example1.xls';
125125

126-
/** Identify the type of $inputFileName **/
126+
/**
127+
* Identify the type of $inputFileName.
128+
* See below for a possible improvement for release 4.1.0+.
129+
*/
127130
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName);
128131
/** Create a new Reader of the type that has been identified **/
129132
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
@@ -134,6 +137,13 @@ $spreadsheet = $reader->load($inputFileName);
134137
See `samples/Reader/04_Simple_file_reader_using_the_IOFactory_to_identify_a_reader_to_use.php`
135138
for a working example of this code.
136139

140+
Prior to release 4.1.0, `identify` returns a file type.
141+
It may be more useful to return a fully-qualified class name,
142+
which can be accomplished using a parameter introduced in 4.1.0:
143+
```php
144+
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName, null, true);
145+
```
146+
137147
As with the IOFactory `load()` method, you can also pass an array of formats
138148
for the `identify()` method to check against if you know that it will only
139149
be in a subset of the possible formats that PhpSpreadsheet supports.

infra/LocaleGenerator.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use PhpOffice\PhpSpreadsheet\Cell\Cell;
77
use PhpOffice\PhpSpreadsheet\IOFactory;
88
use PhpOffice\PhpSpreadsheet\Spreadsheet;
9-
use PhpOffice\PhpSpreadsheet\Worksheet\Column;
10-
use PhpOffice\PhpSpreadsheet\Worksheet\Row;
119
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1210

1311
class LocaleGenerator
@@ -280,11 +278,9 @@ protected function mapLanguageColumns(Worksheet $translationWorksheet): array
280278

281279
$languageNameMap = [];
282280
foreach ($languagesList as $languageColumn) {
283-
/** @var Column $languageColumn */
284281
$cells = $languageColumn->getCellIterator(self::LOCALE_NAME_ROW, self::LOCALE_NAME_ROW);
285282
$cells->setIterateOnlyExistingCells(true);
286283
foreach ($cells as $cell) {
287-
/** @var Cell $cell */
288284
if ($this->localeCanBeSupported($translationWorksheet, $cell)) {
289285
$languageNameMap[$cell->getColumn()] = $cell->getValue();
290286
$this->log($cell->getColumn() . ' -> ' . $cell->getValue());
@@ -316,11 +312,9 @@ protected function mapErrorCodeRows(): void
316312
$errorList = $this->localeTranslations->getRowIterator(self::ERROR_CODES_FIRST_ROW);
317313

318314
foreach ($errorList as $errorRow) {
319-
/** @var Row $errorList */
320315
$cells = $errorRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
321316
$cells->setIterateOnlyExistingCells(true);
322317
foreach ($cells as $cell) {
323-
/** @var Cell $cell */
324318
if ($cell->getValue() != '') {
325319
$this->log($cell->getRow() . ' -> ' . $cell->getValue());
326320
$this->errorCodeMap[$cell->getValue()] = $cell->getRow();
@@ -335,11 +329,9 @@ protected function mapFunctionNameRows(): void
335329
$functionList = $this->functionNameTranslations->getRowIterator(self::FUNCTION_NAME_LIST_FIRST_ROW);
336330

337331
foreach ($functionList as $functionRow) {
338-
/** @var Row $functionRow */
339332
$cells = $functionRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
340333
$cells->setIterateOnlyExistingCells(true);
341334
foreach ($cells as $cell) {
342-
/** @var Cell $cell */
343335
if ($this->isFunctionCategoryEntry($cell)) {
344336
if (!empty($cell->getValue())) {
345337
$this->log('CATEGORY: ' . $cell->getValue());
@@ -348,7 +340,7 @@ protected function mapFunctionNameRows(): void
348340

349341
continue;
350342
}
351-
if ($cell->getValue() !== '') {
343+
if ($cell->getValue() !== '' && $cell->getValue() !== null) {
352344
if (is_bool($cell->getValue())) {
353345
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
354346
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();

0 commit comments

Comments
 (0)