Commit Graph

4440 Commits

Author SHA1 Message Date
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
oleibman a5e47f2b3c Merge pull request #3879 from oleibman/emptyarginif
IF Empty Arguments
2024-01-28 16:16:35 +00:00
oleibman e1bcab6ca9 IF Empty Arguments
Fix #3875. Even better, fix #2146, which has been open for 2.5 years.

Empty arguments are improperly placed on the stack; in particular, they are added without `onlyIf` and `onlyIfNot` attributes.This results in problems described in 3875.

IF has a somewhat unexpected design. In Excel, `IF(false, valueIfTrue)` evaluates as `false`, but `IF(false, valueIfTrue,)` evaluates as 0. This means that IF empty arguments should be handled in the same manner as MIN/MAX/MINA/MAXA, but you need to be careful to distinguish empty from omitted.

Also note that IF requires 2 operands - `IF(true)` is an error, but `IF(true,)` evaluates to 0.
2024-01-27 07:34:37 -08:00
Adrien Crivelli 4a77798f83 2.0.0 2.0.0 2024-01-24 18:41:42 +08:00
oleibman 570c86f950 Merge pull request #3869 from oleibman/bit32b
Fixes for 32-bit
2024-01-23 04:35:24 +00:00
oleibman 132c374f41 Merge branch 'master' into bit32b 2024-01-22 14:24:42 -08:00
Adrien Crivelli a83e9fb70c Merge pull request #3873 from PHPOffice/powerkiki
Remove all `mixed` in param type where reasonable (except Calculcation/)
2024-01-22 15:45:15 +00:00
Adrien Crivelli b9901c3de3 Describe breaking changes 2024-01-22 23:42:49 +08:00
Adrien Crivelli 3dce900eff Typed coordinate and range parameters 2024-01-22 23:26:04 +08:00
Adrien Crivelli ad9fe0a13b Remove all mixed in param type where reasonable (except Calculcation/) 2024-01-22 22:59:24 +08:00
Adrien Crivelli 5faaf26e75 Merge pull request #3872 from PHPOffice/powerkiki
Remove all `mixed` in return type where possible
2024-01-22 01:03:08 +00:00
Adrien Crivelli 013e5ccb73 Remove all mixed in return type where possible 2024-01-22 08:59:42 +08:00
oleibman 936805a6ab Merge pull request #3871 from oleibman/mixedsamples
Eliminate Some "Mixed" Variables in Samples
2024-01-21 06:53:05 +00:00
oleibman d6e4f4c19c Merge branch 'master' into mixedsamples 2024-01-20 16:42:46 -08:00
oleibman 641f86dc80 Eliminate Some "Mixed" Variables in Samples
A continuation of PR #3859. Change code that would be flagged if we were to run Phpstan at level 9 (we currently run level 8). I may or may not follow up with source code (454 level-9 problems remain for src), but there is no reason to avoid the effort for samples.

No changes are made to src.
2024-01-20 16:39:23 -08:00
oleibman 0824fd5f37 Merge pull request #3868 from oleibman/issue3866
Excel Inconsistent Handling of Empty Argument MIN/MAX/MINA/MAXA
2024-01-21 00:36:49 +00:00
oleibman b5e3ca346d Update CHANGELOG.md 2024-01-20 16:28:05 -08:00
oleibman 6ecd141b02 Merge branch 'master' into issue3866 2024-01-20 16:15:01 -08:00
oleibman 73ee354d00 Update MissingArgumentsTest.php
Misplaced "middle missing" argument.
2024-01-16 15:45:28 -08:00
oleibman 5cfe66e18f Fixes for 32-bit
I check from time to time. There are a number of problems now, mostly due to the elimination of Php 7.4 and replacement of doc-block typing with explicit Php typing.
- Bitwise functions were particularly affected by PR #3718 and PR #3793.
- Chart/Axis and Writer/Xlsx were amusingly affected by PR #3836, which added a scaling option which included an array indexed by the known allowable factors, one of which is 1 trillion, which cannot be represented as an integer on a 32-bit system. Issue3833Test, introduced by the same PR (and not suffering any errors) was expanded to test this value.
- Some minor changes to Reader/Xls and Shared/OLE/PPS to accommodate hex values which are negative in 32-bit but which Php-32 may wind up casting to large floating point numbers; it is not clear to me why these hadn't shown up as problems previously. Possibly this is the result of changes in the most recent Php versions.
- BitAndTest, BitOrTest, BitXorTest and Shared/DateTest were adversely affected by PR #3859 when arguments and/or expected results too large for a 32-bit integer were supplied.
- ImExpTest required a slightly reduced precision for 32-bit. No idea why this hadn't shown up earlier.
2024-01-16 13:09:57 -08:00
oleibman 0d6673dd8a Excel Inconsistent Handling of Empty Argument MIN/MAX/MINA/MAXA
Fix #3866. Excel normally treats a missing argument (e.g. `PRODUCT(2,3,)`) as null and ignores it. Not so for MIN/MAX/MINA/MAXA; for those, an empty argument is treated as zero. PhpSpreadsheet is changed to do the same.
2024-01-15 07:56:01 -08:00
oleibman d50b8b5de7 Merge pull request #3856 from oleibman/issue3687
Use Less Space When Inserting Rows and Columns
2024-01-13 16:41:10 +00:00
oleibman 57c6d12e19 Update CHANGELOG.md 2024-01-13 08:38:23 -08:00
oleibman bcd55ef1d3 Merge branch 'master' into issue3687 2024-01-13 07:48:53 -08:00
oleibman bd68ec71ef Merge pull request #3865 from oleibman/issue3863
Excel Omits `Between` Operator for Data Validation
2024-01-12 07:55:23 +00:00
oleibman 3bf77c48df Update CHANGELOG.md 2024-01-11 23:25:44 -08:00
oleibman 3b7c1f6205 Merge branch 'master' into issue3863 2024-01-11 23:22:56 -08:00
oleibman 9e89c36c97 Excel Omits Between Operator for Data Validation
Fix #3863. Data Validation default operator is `between`. When Excel writes out a data validation item, it may omit the operator. Xlsx reader will therefore initialize operator to null string. Issue indicates that user wants `between` returned for `getOperator`. A more serious problem is that `isValid` method does not handle this situation correctly. Data Validation is changed to set Operator to the default value if an attempt is made to set it to null string.
2024-01-11 23:03:55 -08:00
oleibman 6f36db8945 Merge pull request #3855 from oleibman/issue3847
Partial Support of Fill Handles
2024-01-10 18:01:54 +00:00
oleibman 656efb97bf Merge branch 'master' into issue3847 2024-01-10 09:35:10 -08:00
oleibman 085e4435f6 Merge pull request #3862 from oleibman/issue3861
Advanced Value Binder False Positive Looking for Fractions
2024-01-10 05:04:00 +00:00
oleibman 31473ef34b Update CHANGELOG.md 2024-01-09 20:04:56 -08:00
oleibman c88327f749 Merge branch 'master' into issue3861 2024-01-09 19:52:04 -08:00
oleibman 5f232348d7 Advanced Value Binder False Positive Looking for Fractions
Fix #3861. Strings ending in `/` were inappropriately identifed as fractions. Fix regexp accordingly.
2024-01-09 19:29:00 -08:00
Adrien Crivelli 55fea562eb Merge pull request #3860 from PHPOffice/powerkiki
Remove a few mixed type
2024-01-08 07:38:25 +00:00
Adrien Crivelli 637672d783 Remove a few mixed type 2024-01-08 15:36:00 +08:00
oleibman ae72efe43a Merge pull request #3859 from oleibman/mixedtests2
Better Typing in Test Members
2024-01-05 14:57:24 +00:00
oleibman 3eedf9e2f0 Better Typing in Test Members
Change "mixed" declarations to more accurate types in test members; in particular, change those that would be flagged if we were to run Phpstan at level 9 (we currently run level 8). I may or may not follow up with source code (over 700 level-9 problems remain for src), but, as with strict typing, there is no reason to avoid the effort for test members.

It was necessary to update some doc blocks in src to accommodate this change. However, no executable code is touched.
2024-01-05 01:43:50 -08:00
oleibman 77f794cb34 Merge branch 'master' into issue3687 2024-01-04 07:40:39 -08:00
Adrien Crivelli 43481c9deb Merge pull request #3857 from PHPOffice/powerkiki
Restore PSR-16 Simple Cache v1 compatibility
2024-01-04 05:48:27 +00:00
Adrien Crivelli 63b9b974a3 Restore PSR-16 Simple Cache v1 compatibility 2024-01-04 13:45:05 +08:00
Adrien Crivelli a75022a7da Merge pull request #3793 from PHPOffice/powerkiki
Add all missing native types
2024-01-04 05:17:54 +00:00
Adrien Crivelli 76c5b98b8f Drop commented code 2024-01-04 13:08:26 +08:00
Adrien Crivelli b22fde2281 Upgrade QA tools 2024-01-04 13:06:59 +08:00
Adrien Crivelli 332f6418e4 Allow usage of getters before setters 2024-01-04 12:50:52 +08:00
Adrien Crivelli 83f71298ad Also forbid PHPDoc without a variable name 2024-01-04 12:34:47 +08:00
Adrien Crivelli a3c2ca978e Drop redundant PHPDoc 2024-01-04 12:33:06 +08:00
Adrien Crivelli 5cc1ece805 PhpStan 2024-01-04 11:56:46 +08:00
Adrien Crivelli c01abbce09 Merge branch 'master' into powerkiki 2024-01-04 11:51:54 +08:00
oleibman 9c279679aa Use Less Space When Inserting Rows and Columns
Fix #3687. Worksheet methods insertNewRowBefore and insertNewColumnBefore call ReferenceHelper insertNewBefore. That function fills in "missing" cells with null values. However, for boundaries, it uses getHighestRow and getHighestColumn. It should be sufficient to use getHighestDataRow and getHighestDataColumn. When there is a big gap between getHighest... and getHighestData..., this can result in a big increase in memory usage, and in file space when saving the spreadsheet. New test InsertTest demonstrates the problem by populating a worksheet with cells A1:D5 (so highestDataRow is 5), but also setting row 1000 to invisible (so highestRow is 1000).

The major part of the change is in ReferenceHelper::insertNewBefore, which will now use getHighestData... for its boundaries when filling in the missing cells. Changes of less impact are made to duplicateStylesByColumn and duplicateStylesByRow so that cells which don't yet exist are not created unless the style that will be applied is not the workbook default style.

As for reducing the file size, Writer/Xlsx/Worksheet is changed so that cells whose value is null or null-string and which use the workbook default style are not written to the output spreadsheet. This requires some changes to existing test ReadBlankCellsTest; I don't think the difference should matter to the end-user.
2024-01-03 18:03:28 -08:00