Commit Graph

4492 Commits

Author SHA1 Message Date
MarkBaker 868f6d4abe Documentation about Iterating through Cells 2024-03-07 12:37:40 +01:00
oleibman bea48f068c Merge pull request #3929 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.9.0
Bump squizlabs/php_codesniffer from 3.8.1 to 3.9.0
2024-03-01 17:08:05 +00:00
oleibman d1378929c2 Merge pull request #3928 from PHPOffice/dependabot/composer/phpstan/phpstan-phpunit-1.3.16
Bump phpstan/phpstan-phpunit from 1.3.15 to 1.3.16
2024-03-01 17:07:38 +00:00
oleibman 95b9125206 Merge pull request #3927 from PHPOffice/dependabot/composer/phpstan/phpstan-1.10.59
Bump phpstan/phpstan from 1.10.57 to 1.10.59
2024-03-01 17:07:14 +00:00
oleibman 89f996ad95 Merge pull request #3926 from PHPOffice/dependabot/composer/phpunit/phpunit-9.6.17
Bump phpunit/phpunit from 9.6.16 to 9.6.17
2024-03-01 17:06:44 +00:00
oleibman 617393291f Merge pull request #3925 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.51.0
Bump friendsofphp/php-cs-fixer from 3.48.0 to 3.51.0
2024-03-01 17:06:06 +00:00
dependabot[bot] a749480a42 Bump squizlabs/php_codesniffer from 3.8.1 to 3.9.0
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.8.1 to 3.9.0.
- [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.8.1...3.9.0)

---
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-03-01 11:58:44 +00:00
dependabot[bot] e4ff49566e Bump phpstan/phpstan-phpunit from 1.3.15 to 1.3.16
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.15 to 1.3.16.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.15...1.3.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:58:38 +00:00
dependabot[bot] d62172a35d Bump phpstan/phpstan from 1.10.57 to 1.10.59
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.57 to 1.10.59.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.57...1.10.59)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:58:33 +00:00
dependabot[bot] 35c6111a23 Bump phpunit/phpunit from 9.6.16 to 9.6.17
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.16 to 9.6.17.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.6.17/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.16...9.6.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:58:22 +00:00
dependabot[bot] ee1fd8b9aa Bump friendsofphp/php-cs-fixer from 3.48.0 to 3.51.0
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.48.0 to 3.51.0.
- [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.48.0...v3.51.0)

---
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-03-01 11:58:14 +00:00
oleibman 76b2dc70ea Merge pull request #3915 from oleibman/issue3907
Formula Misidentifying Text as Cell After Insertion/Deletion
2024-03-01 01:19:03 +00:00
oleibman c51ec67327 Update CHANGELOG.md 2024-02-29 17:15:36 -08:00
oleibman 4a459e0558 Merge branch 'master' into issue3907 2024-02-29 17:05:04 -08:00
oleibman b020c208c2 Merge pull request #3916 from oleibman/issue3909
Incorrect SUMPRODUCT Calculation
2024-02-29 21:09:04 +00:00
oleibman d09120d209 Merge pull request #3921 from rdey/hotfix/prepending-zero-prc
Fix issue with prepending zero in percentage -10<n<-9
2024-02-28 15:41:43 +00:00
Nicholas Ruunu c1d141bea3 Fix issue with prepending zero in percentage
Before it was a bug when flooring negative numbers added to the length of
the number for the sprintf mask.
For example -0.091 becomes -9.1 in percentage, floors to -10 which is going to
increase $wholePartSize by 1 and add a leading zero to the result: -09.1% with
format 0.0%.
This happened for negative ranges where floor will increse the length of
the original number.
2024-02-27 23:31:16 +01:00
oleibman dc84a51f74 Merge pull request #3906 from oleibman/issue3904c
Improve Performance of Csv Writer
2024-02-23 05:05:15 +00:00
oleibman 3dd40ee634 Update CHANGELOG.md 2024-02-22 20:59:05 -08:00
oleibman 9a685e378a Merge branch 'master' into issue3904c 2024-02-22 20:42:18 -08:00
oleibman 64bdc6424c Incorrect SUMPRODUCT Calculation
Fix #3909. SUMPRODUCT is mishandling multi-row ranges. In Calculation/Calculation, `checkMatrixOperands` will often resize its operands. When it does so, it needs to recalculate the dimensions of each. This fixes the reported problem.

Likely cause was PR #3260. That ticket noted the poor coverage of the code being replaced. Tests of the problem in this ticket were absent and are now added. Despite this, I note that `resizeMatricesShrink` is virtually uncovered, and `resizeMatricesExpand` has substantial gaps in its coverage. I have covered some, but not all, of the Expand gaps. I am struggling to come up with examples to fill its remaining gaps and those for Shrink. However, I will merge this fix in about a week even if I don't succeed.
2024-02-21 22:32:30 -08:00
oleibman a096fcc77d Formula Misidentifying Text as Cell After Insertion/Deletion
Fix #3907. After row/column insertion/deletion, PhpSpreadsheet updates formulas which include cells which have moved. However, it can mis-identify cell addresses within the formula. Examples:
- `=SUM(A2,'F1 (SETTINGS)'!A1:B1)` It identifes F1 as a cell address.
- `=SUM(A2,'x F1 (SETTINGS)'!A1:B1)` It identifes F1 as a cell address. (This looks the same as the above, but, for technical reasons, it's different.)
- `=SUM(A2,definedname1A1)` It identifes A1 as a cell address.
- Sheet names in formulas are compared case-sensitively, and should be compared insensitively. This can make a difference if the formula includes its own sheet name, e.g. on sheet `Data`, formula `=SUM(DATA!A1:A2)` might have to change, but it will not do so with the existing logic.

The defined name part is fairly straightforward. The regular expressions that identify a cell address just have to be a bit more robust. It was doing a negative look-behind for an alphabetic character or dollar sign; underscore, period, and digits, all of which can be part of a defined name, need to be added to that list.

The other situations need a bit of a kludge, but not one so bad that I'm ashamed of it. The formulas will be altered before analysis so that sheet names are replaced with Unicode FFFD (sheetname does not match current sheet), FFFC (sheetname, enclosed in apostrophes, matches current sheet), and FFFB (sheetname, not enclosed in apostrophes, matches current sheet). This prevents the existing regular expressions from finding a cell address within a sheet name, and makes it easy to restore the original, with or without apostrophes, when the sheet name matches the current sheet and the cell(s) which it qualifies have to be changed.

Tests are added for all the situations mentioned above. No existing tests required changes.
2024-02-21 22:10:58 -08:00
oleibman d0393a2eed Merge pull request #3903 from oleibman/issue3900
Handling of User-supplied Decimal and Thousands Separators
2024-02-22 06:04:20 +00:00
oleibman 0c8a80e834 Merge pull request #3914 from PHPOffice/dependabot/composer/phenx/php-svg-lib-0.5.2
Bump phenx/php-svg-lib from 0.5.1 to 0.5.2
2024-02-21 22:36:25 +00:00
dependabot[bot] d0895c65de Bump phenx/php-svg-lib from 0.5.1 to 0.5.2
Bumps [phenx/php-svg-lib](https://github.com/PhenX/php-svg-lib) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/PhenX/php-svg-lib/releases)
- [Commits](https://github.com/PhenX/php-svg-lib/compare/0.5.1...0.5.2)

---
updated-dependencies:
- dependency-name: phenx/php-svg-lib
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 18:29:46 +00:00
oleibman 18a5396eb4 Improve Performance of Csv Writer
Fix #3904. PR #3839 provided a huge performance boost for sparsely populated spreadsheets. Unfortunately, it degraded performance for more densely populated spreadsheets when writing Csvs. The reason is that Csv Writer calls toArray for each row, meaning that a lot of the intermediate data used to speed things up needs to be recalculated for every row. It would be better off calling toArray just once for the entire spreadsheet; however this gives back some of the memory improvements of PR #3834. However, the memory effects can be substantially alleviated by supplying a Generator function to do the work. This PR does that; the result is that Csv Writer is now quite a bit faster, and with only a small memory uptick, vs. its performance in PhpSpreadsheet 1.29.
2024-02-17 08:48:31 -08:00
oleibman 0c37ae2c30 Merge pull request #3898 from oleibman/stanannotations
Eliminate Some Phpstan-ignore Annotations
2024-02-15 05:59:59 +00:00
oleibman e1fb68efc1 Handling of User-supplied Decimal and Thousands Separators
Fix #3900. The code to adjust Decimal and Thousands separators to user-specified choices expects to convert periods to commas and vice versa - hard-coded without taking the user specification into account. This is likely to be the only significant use case, however, as the issue demonstrates, it is not the only possibility. In particular, it will mess up Csv output if decimal separator is kept as period, but thousands separator is set to null string. The code is altered to replace period with the user-selected decimal separator, and comma with the user-selected thousands separator. No existing tests broke as a result of this change in behavior.
2024-02-14 21:20:45 -08:00
Adrien Crivelli c677a2f1c8 Never mention a specific PhpSpreadsheet version in documentation 2024-02-11 14:39:49 +08:00
oleibman 1ac1e7f11f Eliminate Some Phpstan-ignore Annotations
This PR resolves about half the statements which we tell Phpstan to ignore. There will still be 23 such annotations spread over 10 source modules for various reasons (too complicated, suspect PhpSpreadsheet code, one Phpstan bug), plus some deliberate errors in the test suite.
2024-02-08 21:14:14 -08:00
oleibman d620497511 Merge pull request #3893 from oleibman/stanarray2
Phpstan Fixes
2024-02-07 17:44:53 +00:00
oleibman 3512304974 Merge pull request #3897 from oleibman/round84
Floating Point and Php Nightly 8.4
2024-02-07 17:32:00 +00:00
oleibman e4ce0ea8f8 Floating Point and Php Nightly 8.4
Fix #3896. It appears that floating-point arithmetic will give different results in Php 8.4 vs. all earlier releases. This causes tests to fail in the nightly run for ROUNDDOWN, ROUNDUP, and AMORDEGRC. I imagine this won't be the last we hear of this. The failures are a distraction when reviewing PR's. This PR eliminates the distraction by adding in a fudge factor for Php 8.4+ while not changing Php 8.3-. It is not a particularly robust solution, but it should be stable for Php 8.3-, and good enough for Php 8.4+ while I study if a better solution is available.
2024-02-06 12:04:58 -08:00
oleibman 101a31bc24 Phpstan Fixes
Reduce baseline.neon to a single entry.
2024-02-04 20:26:29 -08:00
oleibman d767ee1015 Merge pull request #3892 from oleibman/reorgsamples2
Reorganize Samples Part 2
2024-02-04 21:29:35 +00:00
oleibman 5266086781 Reorganize Samples Part 2
Further reorganization following on PR #3890.
2024-02-04 10:29:41 -08:00
oleibman a444d1c41f Merge pull request #3891 from oleibman/stanarray
Phpstan and ArrayEnabled
2024-02-04 07:11:15 +00:00
oleibman c2f9af660c Merge pull request #3890 from oleibman/reorgsamples
Reorganize Samples
2024-02-04 06:51:23 +00:00
oleibman 6b4cbf1f68 Phpstan and ArrayEnabled
Phpstan baseline had been reduced to almost nothing, but recently had a big bump in size. Almost all of the increase was due to trait ArrayEnabled, which is easily recoded to avoid the problems.
2024-02-03 22:16:16 -08:00
oleibman 17845d8e06 Merge Conflict 2024-02-03 07:31:48 -08:00
oleibman b3de003aa5 Reorganize Samples
The samples have become unwieldy when running them from a browser. In particular, the drop-down lists are fixed size with no scrolling, and many of them are now just too large. I have moved all the Calculation samples up a level, and broken several categories (Basic, Chart, DateTime, Engineering, Financial, and Reader) into several pieces.

Convert-Online (now found in the Engineering category) had a number of different problems which are now resolved. It is the only member with any significant code change.
2024-02-03 07:25:29 -08:00
oleibman ec5e66479d Merge pull request #3888 from TobiasBg/patch-1
Fix spelling of `Xlxs` in class names
2024-02-02 20:38:56 +00:00
Tobias Bäthge 80843f5cff Fix spelling of Xlxs in class names
While not making a functional difference, it's nice to follow naming conventions.

This was discovered when reviewing https://github.com/PHPOffice/PhpSpreadsheet/pull/3887/files#diff-923ac4c5046834ceb5d9bbf617347caa125bbf85f29c62e36ed87d1fe99dd4ea.
2024-02-02 19:23:40 +01:00
oleibman 22f4d6ee17 Merge pull request #3887 from oleibman/updatefixer
Php-cs-fixer Changes
2024-02-01 19:41:59 +00:00
oleibman 84cc3b560f Php-cs-fixer Changes
Its latest update added some new stringencies, resulting in 62 messages. Used `composer fix` to take care of them.
2024-02-01 11:26:22 -08:00
oleibman d93c07bf67 Merge pull request #3885 from PHPOffice/dependabot/composer/phpstan/phpstan-1.10.57
Bump phpstan/phpstan from 1.10.50 to 1.10.57
2024-02-01 17:27:45 +00:00
oleibman 847f39f009 Merge pull request #3884 from PHPOffice/dependabot/composer/phpunit/phpunit-9.6.16
Bump phpunit/phpunit from 9.6.15 to 9.6.16
2024-02-01 17:12:01 +00:00
oleibman f6ac28d838 Merge pull request #3886 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.8.1
Bump squizlabs/php_codesniffer from 3.8.0 to 3.8.1
2024-02-01 17:11:19 +00:00
oleibman ba4ecd17be Merge pull request #3882 from PHPOffice/dependabot/composer/mitoteam/jpgraph-10.4.1
Bump mitoteam/jpgraph from 10.3.2 to 10.4.1
2024-02-01 17:10:04 +00:00
dependabot[bot] 4e4a35b87a Bump squizlabs/php_codesniffer from 3.8.0 to 3.8.1
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.8.0 to 3.8.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.8.0...3.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 11:42:53 +00:00