Commit Graph

3903 Commits

Author SHA1 Message Date
dependabot[bot] cf332477cc Bump dompdf/dompdf from 2.0.2 to 2.0.3 (#3353)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v2.0.2...v2.0.3)

---
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>
Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com>
2023-02-07 13:17:57 -08:00
Mark Baker 11bae5c0c4 Merge pull request #3352 from PHPOffice/PR3329-Additional-Exception-Handling
Additional exception handling to prevent an invalid formula from breaking `isDateTime()`
2023-02-07 20:43:32 +01:00
MarkBaker 8c91bd6942 Additional exception handling to prevent a cell containing an invalid formula from breaking isDateTime() 2023-02-07 18:04:37 +01:00
oleibman 5fb76c83ef Resolve Phpstan Messages in Writer Xls (#3343)
* Resolve Phpstan Messages in Writer Xls

Reduce number of Phpstan messages by addressing their issues. This change does not touch Worksheet, and does not eliminate all Phpstan problems in the modules it does touch.

* Scrutinizer

Yet another false positive.
2023-02-07 07:02:27 -08:00
oleibman 14fd9bddeb Resolve Phpstan Messages in Writer Ods (#3342)
* Resolve Phpstan Messages in Writer Ods

Reduce number of Phpstan messages by addressing their issues.

* Minor Fix

Phpstan reports one fewer error under Php8 than previously.
2023-02-05 18:54:11 -08:00
dependabot[bot] 8841906dae Bump phpunit/phpunit from 9.5.28 to 9.6.3 (#3350)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.28 to 9.6.3.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-05 15:58:02 -08:00
MarkBaker 247f9cb7f9 DealerDirect have renamed the branch for phpcodesniffer-composer-installer from master to main 2023-02-05 13:24:43 +01:00
Mark Baker 560807c07d Merge pull request #3349 from PHPOffice/NumberFormat_Improved-Docblocks
Improved docblocks for toFormattedString()
2023-02-05 12:53:19 +01:00
Mark Baker d2d43d0bf8 Merge branch 'master' into NumberFormat_Improved-Docblocks 2023-02-05 09:48:46 +01:00
MarkBaker 58c1261fff Improved docblocks for toFormattedString(); and some variable renaming in the code for improved readability and purpose 2023-02-05 09:30:55 +01:00
oleibman 590e4c7af1 Allow More Fonts/Fontnames for Exact Width Calculation (#3326)
* Allow More Fonts/Fontnames for Exact Width Calculation

Fix #3190. A limited set of explicitly-named font files can be used when an exact width calculation is required. User noted that font files are named differently on Mac than on Windows (if the fonts are installed on Linux, the font names probably match Windows). Since the algorithm for generating the Mac file name from the font name seems easy, that algorithm is invoked when the Windows-named file is not found.

Moving on from there, it seems odd that only a small set of fonts are supported. It is, of course, impossible to support all possible fonts out of the box. However, it is possible to allow the user to supply additional mappings from font name to file name (or override existing mappings if neither the Windows nor Mac name matches the user's system), and doing so is permitted with this change:
```php
        \PhpOffice\PhpSpreadsheet\Shared\Font::setExtraFontArray([
            'fontname' => [ /* More than 1 can be specified */
                'x' => 'fontfilenamefornormal.ttf',
                'xb' => 'fontfilenameforbold.ttf',
                'xi' => 'fontfilenameforitalic.ttf',
                'xbi' => 'fontfilenameforbolditalic.ttf',
            ],
        ]);
```

* Unexpected Test Difference

... between Windows and Linux.
2023-02-04 07:25:31 -08:00
MarkBaker 393514d4f0 Improved handling of @ format mask 2023-02-04 13:33:11 +01:00
Mark Baker 0f8f35999e Merge pull request #3344 from PHPOffice/Format-Masks_Improved-@
Improved handling of @ format mask
2023-02-04 13:22:28 +01:00
MarkBaker edc003ad16 Improved handling of @ format mask
Note that it still doesn't work fully if in section 4
2023-02-04 12:54:19 +01:00
Mark Baker ad0b68c7cb Merge pull request #3334 from PHPOffice/NumberFormat_Wizards
Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency and Accounting formats
2023-02-03 19:59:36 +01:00
MarkBaker 7ec1969fae Accounting Format PHP Intl Extension and ICU version checks (minimum PHP 7.4.1 and ICU 53) 2023-02-03 18:24:47 +01:00
Mark Baker 777a230765 Merge branch 'master' into NumberFormat_Wizards 2023-02-03 17:29:43 +01:00
MarkBaker e2c5014c43 Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency, and Accounting 2023-02-03 17:14:28 +01:00
oleibman a2282ecb79 Additional Coverage for Reader Xls (#3340)
* Additional Coverage for Reader Xls

More than 750 lines are newly covered, increasing overall coverage on my machine from 91.14% to 93.09%.

* Update FormulasTest.php
2023-02-03 07:42:43 -08:00
Mark Baker e573b45d7f Merge pull request #3339 from PHPOffice/Style_NumberFormat-New-Fractions
Support for fixed value divisor in fractional Number Format Masks
2023-02-02 12:19:59 +01:00
MarkBaker c47af2a344 Support for fixed value divisor in fractional Number Format Masks 2023-02-02 12:00:50 +01:00
Mark Baker 3f8b39ca9a Merge pull request #3336 from PHPOffice/Issue-3355_Quote-Prefix-in-Worksheet-for-Named-Range-Evaluation
Resolution for Issue 3335 - Calculation Engine doesn't evaluate Defined Name when default cell A1 is quote-prefixed
2023-02-01 22:18:32 +01:00
MarkBaker ea3be3b53b Unit tests for evaluation of defined name with a quote-prefixed cell 2023-02-01 21:10:19 +01:00
MarkBaker ddd43ac727 Potential resolution for Issue 3355, where the worksheet for a defined name has a quote-prefixed style for default cell A1.
I wish `_calculateFormulaValue()` was private; sadly not
2023-02-01 19:13:10 +01:00
oleibman 889ad85b84 Resolve Phpstan Messages in Reader Ods (#3324)
* Resolve Phpstan Messages in Reader Ods

Reduce number of Phpstan messages by addressing their issues.

* Update HiddenMergeCellsTest.php
2023-02-01 08:52:26 -08:00
dependabot[bot] 394ac0cf43 Bump friendsofphp/php-cs-fixer from 3.13.1 to 3.14.3 (#3333)
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.13.1 to 3.14.3.
- [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.13.1...v3.14.3)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 07:02:42 -08:00
dependabot[bot] 2446a130b5 Bump phpstan/phpstan from 1.9.2 to 1.9.14 (#3332)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.2 to 1.9.14.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.2...1.9.14)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 06:49:09 -08:00
dependabot[bot] b658f7f220 Bump phpunit/phpunit from 9.5.27 to 9.5.28 (#3331)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.27 to 9.5.28.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.5.28/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.27...9.5.28)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 06:39:26 -08:00
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