Skip to content

Commit 26dfae1

Browse files
authored
Merge branch 'master' into intersect
2 parents 87147c5 + 2f1092c commit 26dfae1

File tree

141 files changed

+1896
-323
lines changed

Some content is hidden

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

141 files changed

+1896
-323
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Setup PHP, with composer and extensions
8282
uses: shivammathur/setup-php@v2
8383
with:
84-
php-version: 8.3
84+
php-version: 8.4
8585
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
8686
coverage: none
8787

@@ -98,7 +98,7 @@ jobs:
9898
- name: Setup PHP, with composer and extensions
9999
uses: shivammathur/setup-php@v2
100100
with:
101-
php-version: 8.3
101+
php-version: 8.4
102102
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
103103
coverage: none
104104
tools: cs2pr
@@ -129,7 +129,7 @@ jobs:
129129
- name: Setup PHP, with composer and extensions
130130
uses: shivammathur/setup-php@v2
131131
with:
132-
php-version: 8.3
132+
php-version: 8.4
133133
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
134134
coverage: none
135135
tools: cs2pr
@@ -160,7 +160,7 @@ jobs:
160160
- name: Setup PHP, with composer and extensions
161161
uses: shivammathur/setup-php@v2
162162
with:
163-
php-version: 8.3
163+
php-version: 8.4
164164
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
165165
coverage: none
166166
tools: cs2pr
@@ -191,7 +191,7 @@ jobs:
191191
- name: Setup PHP, with composer and extensions
192192
uses: shivammathur/setup-php@v2
193193
with:
194-
php-version: 8.3
194+
php-version: 8.4
195195
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
196196
coverage: none
197197
tools: cs2pr
@@ -230,7 +230,7 @@ jobs:
230230
- name: Setup PHP, with composer and extensions
231231
uses: shivammathur/setup-php@v2
232232
with:
233-
php-version: 8.3
233+
php-version: 8.4
234234
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
235235
coverage: pcov
236236

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
'php_unit_test_class_requires_covers' => false, // We don't care as much as we should about coverage
167167
'phpdoc_add_missing_param_annotation' => false, // Don't add things that bring no value
168168
'phpdoc_align' => false, // Waste of time
169-
'phpdoc_annotation_without_dot' => true,
169+
'phpdoc_annotation_without_dot' => false,
170170
'phpdoc_indent' => true,
171171
'phpdoc_line_span' => false, // Unfortunately our old comments turn even uglier with this
172172
'phpdoc_no_access' => true,

CHANGELOG.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org). Thia is always true of the master branch. Some earlier branches remain supported and security fixes are applied to them; if the security fix represents a breaking change, it may have to be applied as a minor or patch version.
77

8-
## TBD - 5.1.0
8+
## TBD - 5.2.0
99

1010
### Added
1111

12-
- Add Conditional Formatting with IconSet (Xlsx only). [Issue #4560](https://github.com/PHPOffice/PhpSpreadsheet/issues/4560) [PR #4574](https://github.com/PHPOffice/PhpSpreadsheet/pull/4574)
13-
- Copy cell adjusting formula. [Issue #1203](https://github.com/PHPOffice/PhpSpreadsheet/issues/1203) [PR #4577](https://github.com/PHPOffice/PhpSpreadsheet/pull/4577)
14-
- splitRange and ProtectedRange. [Issue #1457](https://github.com/PHPOffice/PhpSpreadsheet/issues/1457) [PR #4580](https://github.com/PHPOffice/PhpSpreadsheet/pull/4580)
12+
- Option to display numbers with less precision. [Issue #4626](https://github.com/PHPOffice/PhpSpreadsheet/issues/4626) [PR #4640](https://github.com/PHPOffice/PhpSpreadsheet/pull/4640)
1513

1614
### Removed
1715

@@ -27,11 +25,35 @@ and this project adheres to [Semantic Versioning](https://semver.org). Thia is a
2725

2826
### Deprecated
2927

30-
- Nothing yet.
28+
- Worksheet::getHashInt serves no useful purpose. No replacement.
29+
- Spreadsheet::getId serves no useful purpose. No replacement.
30+
31+
### Fixed
32+
33+
- Performance improvement when working with large amounts of cells. [Issue #4607](https://github.com/PHPOffice/PhpSpreadsheet/issues/4607) [PR #4609](https://github.com/PHPOffice/PhpSpreadsheet/pull/4609)
34+
- Minor improvements to Calculation coverage. [PR #4624](https://github.com/PHPOffice/PhpSpreadsheet/pull/4624)
35+
- Conditional formatting in extLst. [Issue #4629](https://github.com/PHPOffice/PhpSpreadsheet/issues/4629) [PR #4633](https://github.com/PHPOffice/PhpSpreadsheet/pull/4633)
36+
- Php8.5 deprecates use of null as array index. [PR #4634](https://github.com/PHPOffice/PhpSpreadsheet/pull/4634)
37+
- For Php8.5, replace one of our two uses of `__wakeup` with `__unserialize`, and eliminate the other. [PR #4639](https://github.com/PHPOffice/PhpSpreadsheet/pull/4639)
38+
- Use prefix _xlfn for BASE function. [Issue #4638](https://github.com/PHPOffice/PhpSpreadsheet/issues/4638) [PR #4641](https://github.com/PHPOffice/PhpSpreadsheet/pull/4641)
39+
40+
## 2025-09-03 - 5.1.0
41+
42+
### Added
43+
44+
- Add Conditional Formatting with IconSet (Xlsx only). [Issue #4560](https://github.com/PHPOffice/PhpSpreadsheet/issues/4560) [PR #4574](https://github.com/PHPOffice/PhpSpreadsheet/pull/4574)
45+
- Copy cell adjusting formula. [Issue #1203](https://github.com/PHPOffice/PhpSpreadsheet/issues/1203) [PR #4577](https://github.com/PHPOffice/PhpSpreadsheet/pull/4577)
46+
- splitRange and ProtectedRange. [Issue #1457](https://github.com/PHPOffice/PhpSpreadsheet/issues/1457) [PR #4580](https://github.com/PHPOffice/PhpSpreadsheet/pull/4580)
47+
- Option to create Blank Sheet if LoadSheetsOnly doesn't find any. [PR #4618](https://github.com/PHPOffice/PhpSpreadsheet/pull/4618)
3148

3249
### Fixed
3350

3451
- Google-only formulas exported from Google Sheets. [Issue #1637](https://github.com/PHPOffice/PhpSpreadsheet/issues/1637) [PR #4579](https://github.com/PHPOffice/PhpSpreadsheet/pull/4579)
52+
- Maximum column width. [PR #4581](https://github.com/PHPOffice/PhpSpreadsheet/pull/4581)
53+
- PrintArea after row/column delete. [Issue #2912](https://github.com/PHPOffice/PhpSpreadsheet/issues/2912) [PR #4598](https://github.com/PHPOffice/PhpSpreadsheet/pull/4598)
54+
- Remove deprecated imagedestroy call. [PR #4625](https://github.com/PHPOffice/PhpSpreadsheet/pull/4625)
55+
- Excel 2007 problem with newlines. [Issue #4619](https://github.com/PHPOffice/PhpSpreadsheet/issues/4619) [PR #4620](https://github.com/PHPOffice/PhpSpreadsheet/pull/4620)
56+
- Compatibility changes for Php 8.5. [PR #4601](https://github.com/PHPOffice/PhpSpreadsheet/pull/4601) [PR #4611](https://github.com/PHPOffice/PhpSpreadsheet/pull/4611)
3557

3658
## 2025-08-10 - 5.0.0
3759

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This makes it easier to see exactly what is being tested when reviewing the PR.
4343
4. By default, Github removes markdown headings in the Release Notes. You can either edit to restore these, or, probably preferably, change the default comment character on your system - `git config core.commentChar ";"`.
4444

4545
> **Note:** Tagged releases are made from the `master` branch. Only in an emergency should a tagged release be made from the `release` branch. (i.e. cherry-picked hot-fixes.) However, there are 4 branches which have been updated to apply security patches, and those may be tagged if future security updates are needed.
46-
- release1291
47-
- release210
46+
- release1291 (no further updates aside from security patches, including code changes needed for Php 8.5 compatibility)
47+
- release210 (no further updates aside from security patches, including code changes needed for Php 8.5 compatibility)
4848
- release222
4949
- release390

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# PhpSpreadsheet
22

33
[![Build Status](https://github.com/PHPOffice/PhpSpreadsheet/workflows/main/badge.svg)](https://github.com/PHPOffice/PhpSpreadsheet/actions)
4-
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
5-
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
4+
[![Code Coverage](https://coveralls.io/repos/github/PHPOffice/PhpSpreadsheet/badge.svg?branch=master)](https://coveralls.io/github/PHPOffice/PhpSpreadsheet?branch=master)
65
[![Total Downloads](https://img.shields.io/packagist/dt/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
76
[![Latest Stable Version](https://img.shields.io/github/v/release/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
87
[![License](https://img.shields.io/github/license/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
@@ -11,6 +10,17 @@
1110
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
1211
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
1312

13+
This is the master branch, and is maintained for security and bug fixes.
14+
15+
## PHP Version Support
16+
17+
LTS: For maintained branches, support for PHP versions will only be maintained for a period of six months beyond the
18+
[end of life](https://www.php.net/supported-versions) of that PHP version.
19+
20+
Currently the required PHP minimum version is PHP __8.1__, and we [will support that version](https://www.php.net/supported-versions.php) until 30th June 2026.
21+
22+
See the `composer.json` for other requirements.
23+
1424
## Installation
1525

1626
See the [install instructions](https://phpspreadsheet.readthedocs.io/en/latest/#installation).

composer.lock

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

docs/topics/Looping the Loop.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ It can return the raw cell value (which isn't particularly useful if the cell co
5757
| $calculateFormulas | boolean | false | Flag to indicate if formula values should be calculated before returning. |
5858
| $formatData | boolean | false | Flag to request that values should be formatting before returning. |
5959
| $returnCellRef | boolean | false | False - Return a simple enumerated array of rows and columns (indexed by number counting from zero)<br />True - Return rows and columns indexed by their actual row and column IDs. |
60+
| $ignoreHidden | boolean | false | True - Ignore hidden rows and columns. |
61+
| $reduceArrays | boolean | false | True - If calculated value is an array, reduce it to top leftmost value. |
62+
| $lessFloatPrecision | boolean | false | True - PhpSpreadsheet 5.2+ - Floats, if formatted, will display as a more human-friendly but possibly less accurate value. |
6063

6164
### Dealing with empty rows
6265

docs/topics/accessing-cells.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ $highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFrom
472472
echo '<table>' . "\n";
473473
for ($row = 1; $row <= $highestRow; ++$row) {
474474
echo '<tr>' . PHP_EOL;
475+
// Use StringHelper::stringIncrement($col) rather than ++$col if using Php8.5+.
475476
for ($col = 1; $col <= $highestColumnIndex; ++$col) {
476477
$value = $worksheet->getCell([$col, $row])->getValue();
477478
echo '<td>' . $value . '</td>' . PHP_EOL;
@@ -494,11 +495,12 @@ $worksheet = $spreadsheet->getActiveSheet();
494495
$highestRow = $worksheet->getHighestDataRow(); // e.g. 10
495496
$highestColumn = $worksheet->getHighestDataColumn(); // e.g 'F'
496497
// Increment the highest column letter
497-
++$highestColumn;
498+
++$highestColumn; // StringHelper::stringIncrement($highestColumn); if using Php8.5+.
498499

499500
echo '<table>' . "\n";
500501
for ($row = 1; $row <= $highestRow; ++$row) {
501502
echo '<tr>' . PHP_EOL;
503+
// Use StringHelper::stringIncrement($col) rather than ++$col if using Php8.5+.
502504
for ($col = 'A'; $col != $highestColumn; ++$col) {
503505
echo '<td>' .
504506
$worksheet->getCell($col . $row)

docs/topics/migration-from-PHPExcel.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,15 @@ So the code must be adapted with something like:
418418
// Before
419419
$cell = $worksheet->getCellByColumnAndRow($column, $row);
420420

421+
// Use StringHelper::stringIncrement($column) rather than ++$column if using Php8.5+.
421422
for ($column = 0; $column < $max; ++$column) {
422423
$worksheet->setCellValueByColumnAndRow($column, $row, 'value');
423424
}
424425

425426
// After
426427
$cell = $worksheet->getCell([$column + 1, $row]);
427428

429+
// Use StringHelper::stringIncrement($column) rather than ++$column if using Php8.5+.
428430
for ($column = 1; $column <= $max; ++$column) {
429431
$worksheet->setCellValue([$column, $row], 'value');
430432
}

docs/topics/reading-and-writing-to-file.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,26 @@ Because of a bug in the Office2003 compatibility pack, there can be some
181181
small issues when opening Xlsx spreadsheets (mostly related to formula
182182
calculation). You can enable Office2003 compatibility with the following
183183
code:
184-
184+
```php
185185
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
186186
$writer->setOffice2003Compatibility(true);
187187
$writer->save("05featuredemo.xlsx");
188+
```
188189

189190
**Office2003 compatibility option should only be used when needed** because
190191
it disables several Office2007 file format options, resulting in a
191192
lower-featured Office2007 spreadsheet.
192193

194+
#### Maximum Column Width
195+
196+
In the Xlsx User Interface, the user cannot set a column width > 255.
197+
Nevertheless, it will honor a higher value if supplied in the Xml.
198+
PhpSpreadsheet will, by default, allow values > 255 to be written.
199+
However, Excel's behavior, restricting the value to 255, can be emulated:
200+
```php
201+
$writer->setRestrictMaxColumnWidth(true);
202+
```
203+
193204
### Form Control Fields
194205

195206
PhpSpreadsheet offers limited support for Forms Controls (buttons,
@@ -1088,7 +1099,7 @@ $secondHtmlString = '<table>
10881099
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Html();
10891100
$spreadsheet = $reader->loadFromString($firstHtmlString);
10901101
$reader->setSheetIndex(1);
1091-
$spreadhseet = $reader->loadFromString($secondHtmlString, $spreadsheet);
1102+
$spreadsheet = $reader->loadFromString($secondHtmlString, $spreadsheet);
10921103

10931104
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
10941105
$writer->save('write.xls');

0 commit comments

Comments
 (0)