Commit Graph

3941 Commits

Author SHA1 Message Date
MarkBaker 431bd5178e Adjust identifier for Date Format Masking to prevent it picking out currencies with locales containing the letters h, m, s, d and y as dates 2023-02-18 17:46:23 +01:00
Mark Baker 3beef1f559 Merge pull request #3377 from PHPOffice/AdvancedValueBinder_Additional-Minor-Tweaks
Adjust CURRENCY_USD and CURRENCY_EUR constants
2023-02-18 02:04:01 +01:00
MarkBaker 292dd9073f Adjust CURRENCY_USD and CURRENCY_EUR constants to rationalise and eliminate quoted currency symbols in favour of bracketed symbols 2023-02-18 01:39:29 +01:00
Mark Baker a241792b35 Merge pull request #3376 from PHPOffice/AdvancedValueBinder-Localisation
Advanced value binder localisation and Improvements
2023-02-17 13:58:02 +01:00
MarkBaker 22aa65d802 Additional unit tests 2023-02-17 13:31:45 +01:00
MarkBaker f9ef1e0e7d Additional unit tests 2023-02-17 13:29:21 +01:00
MarkBaker 6ca7ec5d5b Make boolean check case-insensitive 2023-02-17 13:14:20 +01:00
MarkBaker 5072ffb23a Improve support for locale settings and currency identification in the Advanced Value Binder 2023-02-17 12:37:18 +01:00
Mark Baker d49bc40573 Merge pull request #3374 from PHPOffice/CalcEngine_Formatted-Number-Localisation
Improve support for locale settings in the Calculation Engine formatted number matcher
2023-02-17 08:16:58 +01:00
MarkBaker 3d7964f568 Improve support for locale settings in the Calculation Engine formatted number matcher 2023-02-17 08:03:28 +01:00
Mark Baker d029042429 Merge pull request #3373 from PHPOffice/CalcEngine_Formatted-Currency-Expand-Currency-Range
Allow a range of different potential currency codes in the currency matcher regexp
2023-02-17 06:43:42 +01:00
Mark Baker 3dd486208b Merge branch 'master' into CalcEngine_Formatted-Currency-Expand-Currency-Range 2023-02-17 06:37:44 +01:00
MarkBaker 4aaf1f61b9 Allow a range of different potential currency codes (including the locale code) in the currency matcher regexp
(dollar, euro, pound sterling and yen)
2023-02-17 06:16:10 +01:00
oleibman 9e1378d806 Resolve Phpstan Messages - Statistical/Trend and Shared/Trend (#3362)
* Resolve Phpstan Messages - Statistical/Trend and Shared/Trend

Reduce number of Phpstan messages by addressing their issues. The changes in this PR are all to doc blocks; no executable code is changed.

* Scrutinizer

1 mystifying "new" error (matches "old" error), 2 updated doc blocks.
2023-02-16 19:18:02 -08:00
oleibman df9e0da514 Additional Functions Coverage for Reader Xls (#3371)
PR #3340 increased coverage in Reader Xls for most functions. Some of the omissions from that PR (see below) were intended from the start. However, the set of (BINOMDIST, EXPONDIST, GAMMADIST, NORMDIST, POISSON, WEIBULL, and FIXED) were not intended to be omitted; they just did not seem to work. Having had time to research, it appears that the problem is not those functions themselves, but rather the use of Boolean constants as function arguments (see issue #3369). Knowing that, it is possible to add those missing functions back in, just taking care to use `0` or `1` or `TRUE()` or `FALSE()` rather than boolean constants as arguments. No update to source or test code; just adding a few new cells to an Xls spreadsheet.

Functions still omitted because they return array results:
- GROWTH
- LINEST
- LOGEST
- MINVERSE
- MMULT
- TRANSPOSE
- TREND

Functions still omitted because they are not implemented in PhpSpreadsheet:
- BAHTTEXT
- CELL
- FREQUENCY
- GETPIVOTDATA
2023-02-15 22:21:15 -08:00
oleibman 8df86e4236 Add Tests for Shared XmlWriter (#3365)
Fill in some very minor coverage gaps.
2023-02-14 21:38:06 -08:00
Mark Baker 5405eafcec Merge pull request #3361 from PHPOffice/Cell-SetValue-Binder-Override
Allow override of the Value Binder when setting a Cell value
2023-02-14 10:28:59 +01:00
MarkBaker b40e131b78 Allow override of the Value Binder when setting a Cell value 2023-02-14 10:13:35 +01:00
oleibman c95a8b7aa5 Update Change Log (#3360)
Catch up.
2023-02-11 23:24:49 -08:00
Mark Baker ff5087c536 Merge pull request #3358 from PHPOffice/Issue-3356_AutoFit-for-Table-AutoFilter
Allow for Table AutoFilter dropdown icon for AutoFit column sizing
2023-02-12 03:01:48 +01:00
Mark Baker 1bcb86c450 Merge branch 'master' into Issue-3356_AutoFit-for-Table-AutoFilter 2023-02-12 02:42:27 +01:00
MarkBaker 35347e7228 Update Change Log 2023-02-12 02:38:45 +01:00
MarkBaker afa64508cc Unit Tests for AutoSizing columns 2023-02-12 02:29:02 +01:00
oleibman 545fc89d8f Resolve Phpstan Messages Reader/Xls Shared/Escher (#3355)
* Resolve Phpstan Messages Reader/Xls Shared/Escher

Reduce number of Phpstan messages by addressing their issues.

* Scrutinizer

Hyperactivity.

* More Scrutinizer

Getting close.

* Even More Scrutinizer

Closer and closer.
2023-02-11 17:21:19 -08:00
MarkBaker 6b1538f9f0 Let column width calculation return a float 2023-02-11 21:23:22 +01:00
oleibman 4e09fd407d Permit Max Column for Row Breaks (#3345)
* Permit Max Column for Row Breaks

Fix #3143. Page break was dropped. Difference between good and bad was the use of attribute `max` in `brk` tag in the good spreadsheet. However, `max` was *not* required in a similar spreadsheet. So the reason for the problem isn't completely explained. Nevertheless, it can't really hurt to capture the `max` value on read (if present) and generate it on write. This resolves the issue. User is also permitted to specify max column when setting a row break programatically. I am not yet in position to document when that might be a good idea.

* Case-sensitive Directory Name

Not a problem on my Windows system.

* Update Documentation and Add Tests

Change is necessitated by probable Excel bug.

* Unhappy With Initial Implementation

I kind of shoe-horned it in. Better to create a new PageBreak class, which will make it easier to accomodate any future surprises about page break handling. The only difficulty with the new approach is making sure getBreaks maintains backwards compatibility. New tests will ensure that.
2023-02-11 07:44:14 -08:00
MarkBaker 57424102f1 When a Worksheet has an AutoFilter, then we make allowance for the AutoFilter dropdown icon in the filter heading when calculating AutoFit column widths.
Because a Table can also have its own AutoFilter, we now have to allow for that possibility as well when calculating column width for AutoFit columns
2023-02-10 23:30:06 +01:00
oleibman b1c754f04b Correct Some Scrutinizer Messages (#3354)
They have crept in recently.
2023-02-09 23:12:22 -08:00
Mark Baker cc3ae628ae Merge pull request #3357 from PHPOffice/Style-NumberFormat_Additional-Fraction-Tests
Additional Unit Tests for Fraction Number Format Mask
2023-02-09 18:21:57 +01:00
MarkBaker a6083e7a64 Additional Unit Tests 2023-02-09 18:03:17 +01:00
MarkBaker 3e74e56207 Update Change Log 2023-02-09 12:42:07 +01:00
Mark Baker 38ea66decd Merge pull request #3338 from fdjohnston/master
Possible fix for issue #3337
2023-02-09 12:37:41 +01:00
MarkBaker 598890be6c Resolve cs issues 2023-02-09 12:20:29 +01:00
Mark Baker 159e7c5997 Merge branch 'master' into master 2023-02-09 11:52:47 +01:00
MarkBaker 350c9ecc7d Updating some docblocks with additional usage details 2023-02-09 00:28:06 +01:00
MarkBaker cd181abd3c Updating Change Log for interim 1.27.1 release 2023-02-08 08:09:43 +01:00
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
fjohnston@avatarasoftware.com 67dd292028 Unit tests for issue #3337
Added two unit tests for issue #3337: one that includes the xlfn prefix, and one that does not.  These tests will ensure that the prefix is being added, when appropriate, within an array formula.
2023-02-06 14:15:56 -05: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