Commit Graph

4657 Commits

Author SHA1 Message Date
oleibman fe162bcf0e Update CHANGELOG.md 2024-06-25 21:58:10 -07:00
oleibman f181a4c66e Merge branch 'master' into year1904 2024-06-22 22:13:42 -07:00
oleibman 43589bc9b6 Make Base Date a Property of Spreadsheet
This change is extracted from PR #2787 by @MarkBaker. That change mostly deals with array functions, and that part will be superseded by PR #3962. However, this part of 2787 is not included in 3962.

Fix #1036 (closed as stale in 2019 and just reopened). Excel spreadsheets can have either of 2 base dates, 1900 or 1904, and the numeric value of any date cells will vary depending on which base date is in use. PhpSpreadsheet has, till now, handled that as a static property of Shared/Date. This does not work well if two spreadsheets with different base dates are open simultaneously. The code is changed to store the base date as a property of the spreadsheet when an Xls/Xlsx spreadsheet is loaded, and use that property when saving an Xls/Xlsx spreadsheet. Any call to `getCalculatedValue` or `getFormattedValue` will temporarily set the Shared/Date value to that of the spreadsheet, and restore it at completion. In order to avoid a BC break, the Xls and Xlsx readers will continue to populate the Shared/Date value as before.
2024-06-22 22:09:22 -07:00
oleibman cabd60ca09 Merge pull request #4060 from oleibman/stan9d
Better Definitions for Mixed Parameters and Values Part 3 of Many
2024-06-23 04:31:16 +00:00
oleibman 275b9480a3 Merge pull request #4069 from mogic-le/yield-docs
Documentation and example for rangeToArrayYieldRows()
2024-06-17 18:21:07 +00:00
Christian Weiske 1c931e2870 Documentation and example for rangeToArrayYieldRows()
Related: https://github.com/PHPOffice/PhpSpreadsheet/pull/3906
2024-06-17 11:29:36 +02:00
oleibman 60baa3a1b6 Merge pull request #4065 from oleibman/issue4004td
More RTL Support for Xlsx/Html Comments
2024-06-11 13:27:54 +00:00
oleibman 5c3b63068e Merge branch 'master' into issue4004td 2024-06-11 06:25:38 -07:00
oleibman a3c6f8f5c6 Update CHANGELOG.md 2024-06-11 06:24:33 -07:00
oleibman b57a549fab More RTL Support for Xlsx/Html Comments
Following up from PR #4006. There is an additional RTL property available. It controls the placement of bidirectional neutral characters (mainly punctuation), as opposed to strong (alphabetic characters) or weak (numeric characters), especially at the beginning or end of a line. The new Comment property textboxDirection will be used for that purpose.

In a discussion in issue #4004 following the implementation of the PR, the comment was mixed RTL and LTR, and this led to some formatting problems. The user was able to overcome these with the timely insertion of Unicode directional control characters, but it would be preferable to have it happen automatically, which this change will permit. However, the use of these control characters cannot be entirely done away with. In the new test case, if one of the all-English lines ended with, say, a colon, it would not display correctly; LRM (left-to-right mark) after the colon would be needed. Likewise, one or two of the comment lines with mixed RTL and LTR (discussed in the issue) is not formatted correctly, and might require LRO/PDF or equivalent.
2024-06-06 16:55:27 -07:00
oleibman 1c06890c7f Merge pull request #4064 from oleibman/issue4063
Handle Empty String in SharedStrings
2024-06-06 13:41:05 +00:00
oleibman 7c1ff62ed4 Update CHANGELOG.md 2024-06-06 06:38:50 -07:00
oleibman 5e26de63a9 Handle Empty String in SharedStrings
Fix #4063. Fix #1560. Fix #1293. PhpSpreadsheet is not accounting for an empty string in Xlsx sharedStrings.xml.The code which parses it in Reader/Xlsx looks for a `t` or `r` tag descending from `si`, but, in this case, the tag is coded as `<si/>`, with neither t nor r tag descending. An else clause is added to set the string to empty string in this case.

I was surprised that this had not turned up before, and a search through the archives found at least 2 earlier reports from 4 years ago. Those had been marked stale; the stale indicator is removed, and the issues are re-opened, to be closed when this PR is merged.
2024-06-06 06:17:02 -07:00
oleibman 85c1512b67 Better Definitions for Mixed Parameters and Values Part 3 of Many
Continuing work started with PR #4016 and PR #4026. Improve documentation within program by making explicit what types of values are allowed for variables described as "mixed". In order to avoid broken functionality, this is done mainly through doc-blocks. This will get us closer to Phpstan Level 9, but many changes will be needed before we can consider that.

This change has more executable code changes than its predecessor. I will wait longer than normal before merging it to allow for additional testing.
2024-06-04 06:47:51 -07:00
oleibman fc74f00795 Merge pull request #4059 from oleibman/run83
Run Tools Using Php8.3
2024-06-04 13:37:15 +00:00
oleibman 133e4fdab9 Scrutinizer Failed Building Php8.3 - Try 8.2 2024-06-03 08:04:46 -07:00
oleibman 68713ecabb Run Tools Using Php8.3
Php8.1 is approaching EOL. Change our tools to run under 8.3 instead. I do not anticipate any difficulty for phpstan, php-cs-fixer, phpcs, phpdoc-types, versions, or coverage. PhpDocumetor needs to run with an updated phar, and I'm not sure whether it will be run until a release happens. No idea how Scrutinizer will handle the change; I'll just have to try it and see.
2024-06-03 07:42:28 -07:00
oleibman 318a82e0f9 Merge pull request #4057 from oleibman/unitstan
Phpunit 10 and Phpstan 1.11
2024-06-03 13:28:08 +00:00
oleibman 192d4a3dd5 Resolve Phpstan missingType.generics
Doc-block changes only; no change to executable code.
2024-06-02 14:40:07 -07:00
oleibman 6be8be8c1b Update Phpunit Command in main.yml 2024-06-01 17:50:22 -07:00
oleibman 9b239ebdb0 Phpunit 10 and Phpstan 1.11
Dependabot suggested some changes this month which required an unusual effort to implement successfully. With the elimination of Php 8.0 as a supported environment, it became possible to use Phpunit 10 rather than 9. Among other considerations, the configuration file for Phpunit is changed. I preserved the Phpunit 9 version under a different name. Aside from the configuration change, several other changes needed to be made to accommodate the change:
- Fix #3993. A peculiar problem indeed. One of the reporters said it had something to do with mocking, but I couldn't duplicate it. But Phpunit 10 revealed the problem in one test (Reader/Xlsx/AutoFilterTest), and that was sufficient for me to apply the trivial source code change to Worksheet/Worksheet.
- Some extra stringency on data providers required extra work in Calculation/CalculationFunctionListTest.
- There was a misplaced label in Calculation/ParseFormulaTest. Likewise in the data member CellGetRangeBoundaries.
- More stringency required changes to data members Shared/Trend/ExponentialBestFit and Shared/Trend/LinearBestFit.
- Issue3982Test testLoadAllRows seemed to go into a memory-acquiring loop in 10 that was not evident in 9. This particular test uses a lot of memory by design, but was included only to establish a base level for the other tests in that member. I feel it is acceptable to skip it for 10.

Phpstan errors with a new release are not unusual. One of the problems this time around was, however, unusual - it is fixed when Phpstan runs under Php8.3, but not for earlier Php releases. Our tools currently use Php 8.1. It is on my to-do list to get Phpstan and other test tools running under 8.3 before 8.1 goes EOL. There are also some configuration file changes needed for Phpstan.

Php-cs-fixer has been taking an increasingly long time to run. They've added an experimental option to permit it to run its checks in parallel. I've changed its configuration to use that option.
2024-06-01 17:39:39 -07:00
oleibman 101f90310f Merge pull request #4054 from PHPOffice/dependabot/composer/dompdf/dompdf-3.0.0
Bump dompdf/dompdf from 2.0.8 to 3.0.0
2024-06-01 13:29:14 +00:00
oleibman 5c8f95cdd4 Merge pull request #4052 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.10.1
Bump squizlabs/php_codesniffer from 3.9.2 to 3.10.1
2024-06-01 13:28:37 +00:00
oleibman 8a22155e09 Merge pull request #4051 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.58.1
Bump friendsofphp/php-cs-fixer from 3.56.1 to 3.58.1
2024-06-01 13:28:22 +00:00
dependabot[bot] caa148ade8 Bump dompdf/dompdf from 2.0.8 to 3.0.0
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 2.0.8 to 3.0.0.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v2.0.8...v3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 11:10:05 +00:00
dependabot[bot] 5db40920cc Bump squizlabs/php_codesniffer from 3.9.2 to 3.10.1
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.9.2 to 3.10.1.
- [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
- [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.9.2...3.10.1)

---
updated-dependencies:
- dependency-name: squizlabs/php_codesniffer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 11:09:56 +00:00
dependabot[bot] 2914239d9c Bump friendsofphp/php-cs-fixer from 3.56.1 to 3.58.1
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.56.1 to 3.58.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.56.1...v3.58.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 11:09:52 +00:00
oleibman 3360608cdd Merge pull request #4042 from oleibman/issue4039
Conditional Range Unions and Intersections
2024-06-01 01:07:59 +00:00
oleibman a6000b63e5 Update CHANGELOG.md 2024-05-31 18:04:55 -07:00
oleibman 1852923c62 Merge pull request #4050 from oleibman/issue4049
Conditional Color Scale Improvements
2024-05-31 15:53:34 +00:00
oleibman 15fb1b542a Merge branch 'master' into issue4049 2024-05-31 08:50:17 -07:00
oleibman 24e6f4d837 Update CHANGELOG.md 2024-05-31 08:48:34 -07:00
oleibman 626b08fcd3 Merge pull request #4026 from oleibman/stan9c
Better Definitions for Mixed Parameters and Values Part 2 of Many
2024-05-31 04:04:05 +00:00
oleibman d539dfa2d5 Merge pull request #4047 from oleibman/issue3557
Writer Mpdf and Tcpdf Borders on Merged Cells
2024-05-30 17:14:48 +00:00
oleibman 60d49eca1c Merge branch 'master' into issue3557 2024-05-30 10:11:18 -07:00
oleibman 52743f9e1b Update CHANGELOG.md 2024-05-30 10:08:51 -07:00
oleibman fcc5cf1369 Minor Test Improvement 2024-05-30 09:35:40 -07:00
oleibman 2760e5abb7 Conditional Color Scale Improvements
Fix #4049. Some possible options were not included for read or write. In addition, although it isn't well documented, it appears that 2-color scale always has 2 cvfo entries in Xml in order minimum/maximum, and 3-color scale always has 3 entries in order minimum/midpoint/maximum.
2024-05-30 00:19:11 -07:00
oleibman 0b4bdfb510 Add Disconnects to Tests 2024-05-29 19:23:33 -07:00
oleibman cf6c8046eb Full(?) Conditional Range Union and Intersection Support
Provide a means to convert a range, possibly with unions and possibly with intersections, into something that both Excel and PhpSpreadsheet can handle. Intersections are changed into unions of the individual cells which they comprise. With this change, Xls Writer now handles intersections (previously it would have thrown an Exception or created a corrupt worksheet if this was attempted), and Xlsx Writer works correctly (it seemed to before, but Excel didn't understand what it wrote). Worksheet::getConditionalRange and ::getConditionalStyles would previously have thrown an Exception when presented with an intersection, and will no longer do so.

**NOTE:** Intersection support is limited to Conditional ranges. Use of intersections in other contexts will usually not achieve the desired result.
2024-05-29 08:19:17 -07:00
oleibman c65674cbcb Merge branch 'master' into issue4039 2024-05-28 17:17:54 -07:00
oleibman c8f5c62e5d Invert Union and Intersection Between Excel and Xml
I don't know why MS did this. We're stuck with it.
2024-05-28 17:01:45 -07:00
oleibman 4be300865c Writer Mpdf and Tcpdf Borders on Merged Cells
Fix #3557. Borders around merged cells are not handled correctly for Mpdf. Although a perfectly acceptable workaround is suggested in the issue, it would be better if things just worked without the workaround. Html and Dompdf work with the existing code. As it turns out, Tcpdf does not work, but for a different reason than Mpdf.

Mpdf was not working because Mpdf does not honor the `!important` attribute in Css. We can get it working almost perfectly by suppressing `border*:none`; the exception is fairly Byzantine, and I'll be glad to discuss the matter should anyone report a problem with it. At any rate, it's not working now in the exception case, so we won't be any worse off.

Tcpdf was not working because the merging of attributes happened only when `useInlineCss` was not being used, but Tcpdf does use it. Merging of border attributes is now added for useInlineCss.
2024-05-27 16:38:04 -07:00
oleibman 68218c175d Merge pull request #4033 from oleibman/condxlsborder
Xls Conditional Border
2024-05-26 01:53:12 +00:00
oleibman d0c49cd666 Merge branch 'master' into condxlsborder 2024-05-25 18:46:13 -07:00
oleibman 8e87f554b1 Merge pull request #4035 from oleibman/issue3982a
Xlsx Reader Optionally Ignore Rows With No Cells
2024-05-25 13:45:54 +00:00
oleibman 75d630cd0e Update CHANGELOG.md 2024-05-25 06:42:38 -07:00
oleibman 7b25b18a8b Merge pull request #4040 from oleibman/issue4036
Csv Reader Allow Use of mimetype=text/html Files Without Extension
2024-05-25 04:23:56 +00:00
oleibman 72f53de761 Update CHANGELOG.md 2024-05-24 21:18:51 -07:00
oleibman a51d3541c0 Php 8.4 Change Affects Test
mime_content_type will recognize files as text/csv rather than text/html.
2024-05-24 21:00:25 -07:00