Commit Graph

3875 Commits

Author SHA1 Message Date
dependabot[bot] 2b4fef2166 Bump dompdf/dompdf from 2.0.1 to 2.0.2 (#3330)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-31 23:29:38 -08:00
oleibman cc347fd1c8 Resolve Phpstan Messages in IOFactory and Several Readers (#3319)
Reduce number of Phpstan messages by addressing their issues. Reader/Ods will require a separate ticket. Reader/Xls will require many separate tickets.
2023-01-31 15:19:58 -08:00
Jonathan Goode fc8966e38d Support for configuring a Chart Title's overlay (#3325)
* Update PR template

* Trim trailing space

* Support for configuring a Chart Title's overlay

* Provide test coverage for getting/setting a Chart Legend's overlay
Add missing docblock
2023-01-30 18:37:18 -08:00
MarkBaker c2f806bae7 Fix minor error in documentation 2023-01-30 12:52:01 +01:00
oleibman 1cdc6cd2fb Breaking Change to toFormattedString and 3 toArray Methods (#3304)
* Breaking Change to toFormattedString and 3 toArray Methods

DocBlock says `toFormattedString` returns string, but code can return int, float, bool, null, or RichText. I think the DocBlock is correct (function name clearly indicates "to string"), and the code needs to change to match it. This is not that big a deal on its own. However, some methods in `Worksheet` call this function by default - `rangeToArray`, `toArray`, and `namedRangeToArray`. All 3 can be called with a parameter so that they don't call `toFormattedString`, but, by default, they do call, and so are affected by this change. Some unit test results are changed as a result of this code change. In all those cases, an additional test is added which would match the previous result.

* Update Change Log

I often skip this till later, but, since it's a breaking change ...

* Scrutinizer, Plus Strange Cast to -0

Avoid Scrutinizer complaint by casting string to float, but ... Php decides resulted should sometimes be `-0`? That caused test failures. Very odd.
2023-01-30 00:54:48 -08:00
MarkBaker c77c39b812 Fix phpcs styling for docblock annotations 2023-01-28 17:09:10 +01:00
MarkBaker 8a122fa165 Minor update in docblocks for row/column isEmpty() definitions 2023-01-28 16:50:47 +01:00
oleibman a950d1042b Resolve Phpstan Messages in Style (except NumberFormat/Formatter) (#3303)
Reduce number of Phpstan messages by addressing their issues.

NumberFormat/Formatter has a problem and needs to be dealt with in a separate ticket.
2023-01-28 01:17:51 -08:00
oleibman a0e6e09557 Resolve Phpstan Messages LookupRef TextData Coordinate ReferenceHelpe… (#3298)
* Resolve Phpstan Messages LookupRef TextData Coordinate ReferenceHelper RichText

Reduce number of Phpstan messages by addressing their issues.

* Scrutinizer

One legitimate observation, one unfathomable false positive.

* Scrutinizer (legitimate)

Reasonable simplification suggestion.
2023-01-27 09:15:08 -08:00
oleibman 8d3097517e Additional Unit Tests for XIRR and XNPV (#3307)
* Additional Unit Tests for XIRR and XNPV

See discussion in issue #3297. Excel result disagreed with PhpSpreadsheet, but it seems apparent that the error is Excel's. Although we have other test cases where Excel and PhpSpreadsheet disagree, those have so far been cases where Excel cannot give an answer because its algorithm does not converge, which is possible for any algorithm. In the issue in question, Excel seems to converge to a different answer; this is different than the other exceptions, and so deserves documentation with a formal test case. The discussion also mentions some cases where XNPV seems to give the wrong result in Excel, and those cases are added for XNPV.

* Scrutinizer

Whatever.
2023-01-24 19:06:22 -08:00
MarkBaker 030a8e2664 Prepare ChangeLog for next release 2023-01-24 21:17:11 +01:00
MarkBaker eeb8582f9c Update ChangeLog 1.27.0 2023-01-24 21:07:45 +01:00
MarkBaker 8fc7d986f2 Formatting in documentation 2023-01-24 11:52:12 +01:00
Mark Baker 366592648c Merge pull request #3315 from PHPOffice/Iterators_Empty-within-range-option
Option to specify a range of columns/rows for the Row/Column `isEmpty()` methods
2023-01-23 11:50:02 +01:00
MarkBaker 4b72546050 Option to specify a range of columns/rows for the Row/Column isEmpty() methods 2023-01-23 11:35:19 +01:00
MarkBaker 4e79838da4 Patreon 2023-01-22 17:17:56 +01:00
MarkBaker 79c49ea99a Patreon 2023-01-22 13:32:35 +01:00
Mark Baker 964eb2750d Merge pull request #3314 from PHPOffice/CellIterator-Option-to-create-new-cell-or-return-null
Provide an option for Cell Iterators to return a null or create a new cell when cell doesn't exist
2023-01-21 18:17:48 +01:00
MarkBaker 8ad39f7cc9 Update Documentation 2023-01-21 17:40:30 +01:00
MarkBaker 27bdda2aa7 Update Change Log 2023-01-21 17:40:30 +01:00
MarkBaker 9a752ef5b3 Provide an option that determines whether Cell Iterators should create a new cell or return a null when they try to access a cell that does not exist 2023-01-21 17:40:30 +01:00
Mark Baker 5419eee3b6 Merge pull request #3311 from PHPOffice/StructuredReference_Invalid-Column-return-#REF!
For Structured References, an Invalid column reference should return an Excel #REF! error
2023-01-21 11:54:36 +01:00
Mark Baker 346ec071e4 Merge branch 'master' into StructuredReference_Invalid-Column-return-#REF! 2023-01-21 11:18:48 +01:00
MarkBaker d0910bd263 Additional unit tests for invalid column name 2023-01-21 02:47:33 +01:00
MarkBaker e02439aeb1 For Structured References, an Invalid column reference should return an Excel #REF! error 2023-01-21 02:42:12 +01:00
oleibman 84e4896192 Catch Up Change Log (#3313)
Prior to release 1.27.
2023-01-20 17:41:30 -08:00
oleibman 6443416828 Xls Reader Vertical Break and Writer Page Order (#3306)
Fix #3055. Xls Reader can set vertical break specifying row 0, causing an exception. It is doubtful that Excel needs a row for a vertical break; code is changed to use row 1 if the input file specifies row 0 (or lower). Code in question has not been exercised in unit test suite. Similarly, code to set horizontal break (which probably does not have a bug) is not exercised in test suite. Finally, page order in Writer incorrectly uses value in opposite way that Reader does. A new sample is added to illustrate that these are all handled correctly; it is easier to verify this by visually comparing the source spreadsheet and the copy made from it. A unit test is also added for the same spreadsheet to formally assert that the 3 properties in question are both read and written correctly.
2023-01-20 17:33:19 -08:00
Mark Baker 1194b25575 Merge pull request #3309 from PHPOffice/RowIterator_Destructor
Add destructor for RowIterator to ensure disconnection from worksheet
2023-01-20 12:48:52 +01:00
MarkBaker 89c67431a8 Add destructor for RowIterator to ensure disconnection from worksheet 2023-01-20 12:30:57 +01:00
Mark Baker da3bcc3fe4 Merge pull request #3302 from PHPOffice/Iterator_Method-Synonyms
getColumnIterator() and getRowIterator() synonyms for getCellIterator() methods
2023-01-19 13:43:07 +01:00
MarkBaker 7127c73108 getColumnIterator() getRowIterator() synonyms for getCellIterator() methods in Row and Column objects 2023-01-19 12:56:45 +01:00
Mark Baker 80e270b2a3 Merge pull request #3300 from PHPOffice/Reader-Options_Docblock-Updates
Update to docblocks
2023-01-18 09:23:37 +01:00
Mark Baker ce81ca8862 Merge branch 'master' into Reader-Options_Docblock-Updates 2023-01-17 23:24:01 +01:00
MarkBaker c9d9207b12 Update to docblocks 2023-01-17 18:09:57 +01:00
oleibman 8497a320ea Resolve Phpstan Messages in Calculation Statistical (#3290)
* Resolve Phpstan Messages in Calculation Statistical

Reduce number of Phpstan messages by addressing their issues.

I did not eliminate the messages for Trends, because I did not understand why it is working as it does, so felt it was better to leave it alone.

* Scrutinizer

A new false positive.
2023-01-16 07:19:39 -08:00
oleibman c93d2a53db Resolve Phpstan Messages in Calculation Functions Internal and MathTrig (#3288)
Reduce number of Phpstan messages by addressing their issues.
2023-01-16 06:15:02 -08:00
oleibman ac5299b5df Minor Fix for AND/OR/XOR (#3287)
* Minor Fix for AND/OR/XOR

These 3 fall into the set of functions where Excel treats string literals differently depending on whether they are passed to the function directly or as a cell reference. PhpSpreadsheet is updated to try to duplicate that logic. New tests are added. Some existing test results had to change as a result of this code change.

* Adopt A Suggestion From Mark Baker

Reduce if statements by adding functions.
2023-01-16 05:35:28 -08:00
Jonathan Goode b043a01055 RE: #3294 - provide a sample that sets the X-axis as type "value" (#3295) 2023-01-15 08:59:00 -08:00
oleibman a5f1de02e3 Resolve Phpstan Messages in Calculation Financial (#3284)
Reduce number of Phpstan messages by addressing their issues.
2023-01-15 08:18:33 -08:00
oleibman 811406ba7a Resolve Phpstan Messages in Calculation Engineering and DateTime (#3283)
Reduce number of Phpstan messages by addressing their issues.
2023-01-14 07:29:51 -08:00
oleibman a3f3d2c9ad Clean Up Documentation for Worksheet (#3281)
* Clean Up Documentation for Worksheet

This PR was intended to clean up Phpstan/Scrutinizer messages regarding Worksheet. It is, for the most part, straightforward, but there is one problem which complicates things. The frequently-called public method `getParent` returns `Worksheet` or `null` but is documented to return only `Worksheet`. This can be addressed in either of two ways - change the code to match the documentation (smaller number of changes but a backwards compatibility break), or change the documentation to match the code (larger number of changes but no compatibility break). I have prepared a PR for each approach, but avoiding a compatibility break seems better, so I am pushing the latter. I can switch to the other if preferred. Most existing internal calls to `getParent` are changed to use a new method `getParentOrThrow`, which will throw an exception if parent is null. These calls would all have thrown a null pointer exception anyhow in that situation, so this should not cause any new breaks.

* Scrutinizer

One false positive, and one message leading to a minor code improvement.
2023-01-11 23:34:52 -08:00
oleibman e742bf2294 Attempt To Honor Fit to 1-Page Height for Html/Pdf (#3279)
* Attempt To Honor Fit to 1-Page Height for Html/Pdf

Fix #3266. Each sheet in a spreadsheet can specify that it be set to fit width or height to a fixed number of pages. Mpdf and most browsers already handle the common case of fit to 1 page wide; I am unable to find a solution for Dompdf or Tcpdf. Code is added for the common case of fit to 1 page high when possible; this will usually work in Mpdf, Dompdf, and most browsers. I am not able to come up with a way to handle fit to more than 1 page wide or high.

* Synchronizer

Remove one unused assignment in test.
2023-01-11 12:02:21 -08:00
oleibman d5b13f64d5 Change Test To Avoid Bug in Latest Php (#3289)
Unit tests were failing at Github, having nothing to do with PhpSpreadsheet. Change test to avoid bug, which is reported at https://github.com/php/php-src/issues/10285
2023-01-10 20:19:57 -08:00
Mark Baker 9f0ec1cb35 Merge pull request #3282 from PHPOffice/Reader_Minor-Flag-Modifications
IGNORE_EMPTY_CELLS flag
2023-01-07 11:59:59 +01:00
MarkBaker 8406cc6176 IGNORE_EMPTY_CELLS flag 2023-01-07 11:16:32 +01:00
Mark Baker 4b16f36bf4 Merge pull request #3278 from kbond/issue-3277-reproducer
Reproducer for #3277
2023-01-04 11:43:06 +01:00
Mark Baker 8602496fcb Merge branch 'master' into issue-3277-reproducer 2023-01-04 11:37:19 +01:00
MarkBaker 6f29e9ea49 Fix for single row/column tables... though very weird to create manually in MS Excel, because creating a single row table always creates a two row table (1 row headers and 1 row data). But subsequently hiding the header row; and then deleting that row will create such a table. 2023-01-04 11:17:46 +01:00
oleibman 46fdc87bf8 Update Change Log (#3280)
Add changes from last month not already included.
2023-01-03 19:27:54 -08:00
Kevin Bond 9366c3ea8f add reproducer 2023-01-03 11:52:46 -05:00