Commit Graph

5871 Commits

Author SHA1 Message Date
oleibman 78190ffdb6 Prepare to Deprecate Optionality of Second Arg to Cell::setValueExplicit
In PR #4716, @RobinvanderVliet points out that Cell::setValueExplicit and Worksheet::setCellValueExplicit are strangely inconsistent, where the latter requires you to specify a DataType but the former does not. The fix in that PR is to make the latter offer a default DataType rather than requiring the parameter. While that does eliminate inconsistency, I think it does so in the wrong direction - the solution should be to eliminate the optionality in the former - an implicit value for setValueExplicit just doesn't make sense. We can't do that without a breaking change, which this is not. However, we can update the doc-block and change log to indicate our intention to make that change in the next breaking release.
2025-11-21 00:12:07 -08:00
oleibman a61f9f1b66 Merge pull request #4701 from oleibman/phpstan2131
Upgrade Phpstan
2025-11-01 15:29:21 +00:00
oleibman 93c5f0d93d Coverage Tweak 2025-11-01 07:58:15 -07:00
oleibman e88eaa6d95 Upgrade Phpstan
Too many new errors when Dependabot tried to upgrade.
2025-11-01 07:12:39 -07:00
oleibman 4db18eadd4 Merge pull request #4698 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.89.1
Bump friendsofphp/php-cs-fixer from 3.88.2 to 3.89.1
2025-11-01 11:35:56 +00:00
oleibman 22682a1326 Merge pull request #4700 from PHPOffice/dependabot/composer/dompdf/dompdf-3.1.4
Bump dompdf/dompdf from 3.1.2 to 3.1.4
2025-11-01 11:35:36 +00:00
dependabot[bot] 4dfe452214 Bump dompdf/dompdf from 3.1.2 to 3.1.4
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v3.1.2...v3.1.4)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-version: 3.1.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 11:01:14 +00:00
dependabot[bot] 03d4751586 Bump friendsofphp/php-cs-fixer from 3.88.2 to 3.89.1
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.88.2 to 3.89.1.
- [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.88.2...v3.89.1)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  dependency-version: 3.89.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 11:01:05 +00:00
oleibman 4cb69539aa Merge pull request #4694 from krowinski/patch-1
Fix typo in composer.json for intl extension
2025-10-27 15:01:42 +00:00
Kacper Rowiński 398891f97e Fix typo in composer.json for intl extension 2025-10-27 13:01:26 +01:00
oleibman 3b8994b3aa Merge pull request #4692 from oleibman/prep520
Prepare for Release 5.2.0
5.2.0
2025-10-26 15:54:22 +00:00
oleibman f5257038aa Prepare for Release 5.2.0 2025-10-26 08:38:27 -07:00
oleibman 0cab37fa7c Merge pull request #4689 from oleibman/listdimensions
Xls Reader ListWorksheetInfo and New ListWorksheetDimensions
2025-10-24 01:05:40 +00:00
oleibman 86555ffa4f Update CHANGELOG.md 2025-10-23 18:02:42 -07:00
oleibman 030ece8666 Merge branch 'master' into listdimensions 2025-10-23 17:36:09 -07:00
oleibman 6494ddb9ae Merge pull request #4690 from BackEndTea/fix-phpstan-issues
Fix phpstan issues by making Escher generic
2025-10-24 00:14:50 +00:00
oleibman 02090c1d3f Another Test 2025-10-23 17:07:26 -07:00
gertdepagter 1adad7565c Fix phpstan issues by making Escher generic
This removes the need to check if a method exists
2025-10-23 21:47:13 +02:00
oleibman d5b9ba68e2 New Tests 2025-10-23 12:18:59 -07:00
oleibman ee03c0a467 Add Some Coverage 2025-10-21 09:58:26 -07:00
oleibman c3a78e480d Xls Reader ListWorksheetInfo and New ListWorksheetDimensions
PR #4687 corrected how Xls Writer generated its Dimensions records. We ignore the Dimensions record on read since it does not affect our processing in the slightest. However, the PR raises the possibility that someone might wish to see the data in the Dimensions record. (The PR did an adequate test for retrieving Dimensions data, but it is not generalizable.) To accommodate such a case, we add a new ListWorksheetDimensions function to Xls Reader, similar to ListWorksheetInfo. As luck would have it, the spreadsheet with which I tested the new function produced incorrect results for ListWorksheetInfo, which was ignoring XLS_TYPE_MULRK records. So I added the necessary code to fix ListWorksheetInfo as well.
2025-10-21 07:12:20 -07:00
oleibman 09fab17fb8 Merge pull request #4687 from zlatanovic-nebojsa/fix-dimensions-record
Fix BIFF8 DIMENSIONS record to use 0-based column indices
2025-10-21 13:46:50 +00:00
oleibman 21dc7fb56b Update CHANGELOG.md 2025-10-21 06:40:39 -07:00
Nebojša Zlatanović adde74b4e6 Fix DIMENSIONS record to use 0-based indices for both rows AND columns
The initial fix only converted column indices to 0-based, but overlooked
that row indices also need the same treatment per BIFF8 specification.

Changes:
- Convert firstRowIndex from 1-based to 0-based (subtract 1)
- Convert lastRowIndex from 1-based to 0-based (subtract 1)
- Update row capping logic for 65536 limit
- Fix test assertions to expect rwMic=0 and rwMac=5 (not 1 and 6)
- Enhanced documentation to clarify all DIMENSIONS indices are 0-based

This now matches the behavior observed in Excel-generated XLS files,
where a file with 3 rows × 5 columns shows: rwMic=0, rwMac=3, colMic=0, colMac=5

All tests pass (53 tests, 244 assertions).
2025-10-20 09:07:39 +02:00
Nebojša Zlatanović f2ea8b6cb9 Fix PHPStan type safety issues in DimensionsRecordTest
Add proper type assertions to handle potential false returns:
- Assert file_get_contents() returns string, not false
- Assert strpos() returns int, not false
- Assert unpack() returns array, not false

This resolves all 7 PHPStan errors reported in CI while maintaining
test functionality (12 assertions, all passing).
2025-10-17 13:35:12 +02:00
Nebojša Zlatanović b9857e53d5 Improve DIMENSIONS record fix with better code coverage and unit tests
This commit refines the BIFF8 DIMENSIONS record fix by:

1. **Optimized column index capping**: Replaced the if-statement with min()
   function to ensure lastColumnIndex never exceeds 255, improving code
   coverage and eliminating unreachable branches in unit tests.

2. **Added comprehensive unit tests**: Created DimensionsRecordTest.php which
   directly parses the binary DIMENSIONS record (0x0200) from XLS files to
   verify correct 0-based column indices.

The tests validate:
- colMic (first column) = 0 for column A (was incorrectly 1 before fix)
- colMac (last column + 1) uses proper 0-based indexing
- Column indices are correctly capped at 255 (BIFF8 limit)

These tests fail without the fix and pass with it, ensuring the DIMENSIONS
record is correctly written for compatibility with legacy XLS parsers that
expect 0-based column indices per the BIFF8 specification.
2025-10-17 13:26:55 +02:00
Nebojša Zlatanović 387ed72ca4 Fix BIFF8 DIMENSIONS record to use 0-based column indices
The XLS writer incorrectly used 1-based column indices in the BIFF8
DIMENSIONS record, violating the Microsoft Excel Binary File Format
specification which requires 0-based indices.

This bug caused an extra empty column to appear when converting XLS
files to other formats (e.g., CSV).

Changes:
- Modified column index initialization to subtract 1 from the result
  of Coordinate::columnIndexFromString() to convert from 1-based to
  0-based indexing
- Updated COLINFO loop to use the corrected 0-based lastColumnIndex

Per BIFF8 specification:
- colMic (first column) must be 0-based
- colMac (column after last column) must be 0-based

Example: For columns A-G (7 columns):
- Before: colMic=1, colMac=8 (incorrect)
- After:  colMic=0, colMac=7 (correct)

Fixes #4682
2025-10-17 08:52:44 +02:00
oleibman eecfb6712d Merge pull request #4685 from oleibman/mito105_master
Upgrade Mitoteam for Php8.5 master
2025-10-16 15:34:20 +00:00
oleibman 17e486f75a Upgrade Mitoteam for Php8.5 master 2025-10-16 08:14:29 -07:00
oleibman b100d21779 Merge pull request #4675 from oleibman/issue4673
More Sophisticated Workbook Password Algorithms (Xlsx only)
2025-10-12 23:38:00 +00:00
oleibman 12ac9529b2 Update CHANGELOG.md 2025-10-12 16:34:55 -07:00
oleibman fba2a43c8c Merge branch 'master' into issue4673 2025-10-12 15:21:52 -07:00
oleibman b5ba4ffa24 Merge pull request #4655 from oleibman/issue850
Better Support For Style Alignment Read Order
2025-10-11 19:26:32 +00:00
oleibman 5d0e2bda18 Update CHANGELOG.md 2025-10-11 12:23:38 -07:00
oleibman d52dbaa632 Merge pull request #4666 from oleibman/tcpdfnodie
Offer Tcpdf Interface Which Throws Exception Rather than Die
2025-10-11 18:47:10 +00:00
oleibman 7c9f42e9ea Merge pull request #4676 from oziriemeka/fix/4505-vml-namespace
Xlsx: register x and o namespaces for VML shapes; add test for #4505
2025-10-11 18:38:00 +00:00
oleibman db1aba6554 Better Sample File 2025-10-09 08:19:12 -07:00
oleibman ade225f610 Merge pull request #4669 from karrakoliko/fix-undefined-array-key-x
fix: do not trigger `Undefined array key "x"`
2025-10-07 14:38:50 +00:00
oleibman 4c79da5166 Merge branch 'master' into issue4673 2025-10-05 12:28:50 -07:00
karrakoliko b8687edd53 fix: do not trigger Undefined array key "x" 2025-10-04 16:15:27 +07:00
oleibman 4b24f82422 Merge pull request #4678 from oleibman/continueonerror
Account Better for Coveralls Failure
2025-10-04 03:44:39 +00:00
oleibman c396f5f34e Use Coveralls Parameter Rather than Github's 2025-10-03 20:19:40 -07:00
oleibman be22081946 Account Better for Coveralls Failure 2025-10-03 18:16:05 -07:00
Emeka Oziri 8fcde62db6 Xlsx: register x and o namespaces for VML shapes; add test for #4505
Fixes SimpleXMLElement::xpath(): Undefined namespace prefix when reading VML comments/shapes by registering x: (Excel) and o: (Office) namespaces alongside v:.

Includes:
- tests/PhpSpreadsheetTests/Reader/Xlsx/Issue4505Test.php
- tests/data/Reader/XLSX/issue.4505.xlsx

Refs: https://github.com/PHPOffice/PhpSpreadsheet/issues/4505
2025-10-03 23:37:56 +01:00
oleibman 08a6e7549f More Sophisticated Workbook Password Algorithms (Xlsx only)
Fix #4673. Our password hasher can handle different algorithms, but the workbook password (for maintaining the structure of the workbook, not for encrypting the entire workbook) currently supports only the single algorithm that was in place many years ago. Expand it, and Xlsx Reader and Writer, to be able to use, say, SHA-512, which is what Excel itself uses.

The revisions password needs to be expanded in the same way as the workbook password. It is used for file sharing, but MS has deprecated it because it feels that modern technologies introduce better ways to accomplish what it was needed for. You'll need to look pretty hard to even find it in Excel - it's not, for example, on any of the ribbons. Nevertheless, the solution here is pretty much identical to the solution for the workbook password, so I am fixing it at the same time.
2025-10-03 13:07:36 -07:00
oleibman 0c459cbd5d Merge pull request #4674 from oleibman/stan20251001
Phpstan Update
2025-10-01 16:12:04 +00:00
oleibman 14ad63c56a Phpstan Update 2025-10-01 09:08:10 -07:00
oleibman 228bbed026 Merge pull request #4671 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.88.2
Bump friendsofphp/php-cs-fixer from 3.85.1 to 3.88.2
2025-10-01 14:49:23 +00:00
oleibman a57275b4ec Merge pull request #4672 from PHPOffice/dependabot/composer/dompdf/dompdf-3.1.2
Bump dompdf/dompdf from 3.1.1 to 3.1.2
2025-10-01 14:48:55 +00:00
dependabot[bot] 3aa80e7150 Bump dompdf/dompdf from 3.1.1 to 3.1.2
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-version: 3.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 11:01:38 +00:00