Commit Graph

3744 Commits

Author SHA1 Message Date
oleibman d2deb133bc Fix Unintential Deprecated Calls in Tests - STATISTICAL (#3181)
* Fix Unintential Deprecated Calls in Tests - STATISTICAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed One Deprecation

Fix it now.

* Run Tests in Spreadsheet Context

This is quite a bit more difficult for Statistical than for the other Calculation categories. This is partly because of the use of multi-dimensional matrices, and also because some arguments are interpreted differently when they come from a cell rather than entered directly in a formula. This push leaves 18 out of 89 test members unchanged, except that they are marked with a TODO to show that the work isn't finished. I will not revisit them as part of this PR, but probably will take a look in a subsequent ticket.
2022-11-25 13:57:17 -08:00
oleibman 1fcfadc4b8 Fix Unintential Deprecated Calls - Everything Else (#3183)
* Fix Unintential Deprecated Calls - Everything Else

I think it's best to install these before PR #3166. This one, which I hope to be the last in this series, does have some minor changes to source code, as well as to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Some Remaining Deprecations in Tests

Fix them now.

* Minor Docblock Updates

Worksheet::unprotectCellsByColumnAndRow was incorrect. Other changes are cosmetic, leading to slightly better documentation.

* Update Worksheet.php
2022-11-25 13:06:52 -08:00
Mark Baker 51a1d6e11f Merge pull request #3211 from PHPOffice/CalcEngine-FormattedNumbers_Thousands-Separator
Allow thousands separator in formatted numeric strings
2022-11-25 20:20:47 +01:00
MarkBaker 04be65aee8 Allow thousands separator in formatted numeric strings to be handled as numbers by the Calculation Engine 2022-11-25 20:03:48 +01:00
Mark Baker e1514ac24c Merge pull request #3210 from PHPOffice/CalcEngine-FormattedNumbers_Thousands-Separator-in-Percentages
Allow thousands separator in percentage formatted strings in formulae
2022-11-25 19:34:18 +01:00
MarkBaker 12581cbb72 Allow thousands separator in percentage formatted strings used as numbers by the Calculation Engine 2022-11-25 19:13:20 +01:00
oleibman a884013d00 Fix Unintential Deprecated Calls in Tests - FINANCIAL (#3180)
* Fix Unintential Deprecated Calls in Tests - FINANCIAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Change Tests to Run in Spreadsheet Context

Found and fixed some problems with how MIRR handles errors.
2022-11-25 07:19:19 -08:00
MarkBaker 6607b935cf Update Change Log 2022-11-25 14:51:01 +01:00
MarkBaker 1bb0a637ca Update Change Log 2022-11-25 14:22:21 +01:00
Mark Baker bdb34b94b5 Merge pull request #3189 from fdjohnston/currencies_stored_as_strings
Handle Currencies Stored as Strings in Formulas
2022-11-25 14:19:45 +01:00
Mark Baker 80e4d3a4ed Merge branch 'master' into currencies_stored_as_strings 2022-11-25 14:04:15 +01:00
MarkBaker 171d7684d6 Allow currency numeric strings with thousands separator 2022-11-25 13:15:10 +01:00
Mark Baker 6a259d9745 Merge pull request #3173 from PHPOffice/CalcEngine-Feature_Structured_References
Calculation Engine initial support for Structured References in formulae
2022-11-25 07:37:23 +01:00
Mark Baker 1152196e32 Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-24 23:56:08 +01:00
MarkBaker 57885b916c Validate table name for uniqueness on setting name or binding to a worksheet 2022-11-24 22:01:54 +01:00
oleibman d93a303371 Fix Unintential Deprecated Calls in Tests - ENGINEERING (#3176)
* Fix Unintential Deprecated Calls in Tests - ENGINEERING

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* Fix Deliberate Deprecated Tests

Add annotations.

* Run Unit Tests in Spreadsheet Context

This turned up only one error, in IMSUB. The only group that still needs this is Statistical. Not sure if I will get to that quickly.
2022-11-24 07:57:41 -08:00
Mark Baker 7d2772ea2d Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-23 17:08:29 +01:00
oleibman 3697352e28 Fix Unintential Deprecated Calls in Tests - LOGICAL (#3178)
* Fix Unintential Deprecated Calls in Tests - LOGICAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Change Unit Tests to Run in Spreadsheet Context

They had been run as direct calls, which is not how most users would use them. Making this change exposed some minor coding errors - SWITCH needs to flatten its arguments, and IFERROR and IFNA were not handling a null testValue in the same manner as Excel.
2022-11-23 07:49:28 -08:00
Mark Baker b6fda7fd78 Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-23 16:10:40 +01:00
oleibman ca1ff07fbe Fix Unintential Deprecated Calls in Tests - DATABASE (#3175)
* Fix Unintential Deprecated Calls in Tests - DATABASE

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation Blocks

Deprecated->deprecated, adjust see and comments

* Fix Deliberate Deprecated Tests

Add annotations.

* Change Unit Tests to Run in Spreadsheet Context

... rather than as direct calls. The major difference is that specifying an invalid column should result in an Excel error, not null. Minor code changes were needed, including to Statistical/Conditional which sometimes calls Database.

* Correct Some DocBlocks

Null is no longer a possible output for most of these functions.

* 2 Overlooked Tests

Change to run in spreadsheet context.

* T Function Should Return Null-String, not Null

Fix it.
2022-11-23 06:54:51 -08:00
Mark Baker fa6e1791f8 Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-23 13:33:50 +01:00
MarkBaker 717ec4f73a Eliminate redundant assignment 2022-11-23 03:38:56 +01:00
Mark Baker a3187a3d3e Merge pull request #3199 from PHPOffice/Functionality-Prevent-Serialization
Explicitly prevent serialization of the Spreadsheet object
2022-11-23 03:14:04 +01:00
Mark Baker f4e5318bb2 Merge branch 'master' into Functionality-Prevent-Serialization 2022-11-23 02:58:33 +01:00
MarkBaker f6fdd3198d Minor refactoring of binary operations processing to use a lookup table for matrix operation names 2022-11-22 19:39:48 +01:00
MarkBaker c704d4e990 Refactor the stack processor to identify Structured Reference tokens early, so that they can be converted to a cell address or cell range before continuing through the stack processor logic (although at this point, we're just throwing an Exception) 2022-11-22 18:08:04 +01:00
oleibman fe79f7b02c Fix Unintential Deprecated Calls in Tests - INFORMATION (#3177)
* Fix Unintential Deprecated Calls in Tests - INFORMATION

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed Some Deprecated Calls

Fix them now.
2022-11-22 07:14:19 -08:00
oleibman c2bf9cdf9e Restore Cyclic Error Messages (#3170)
Fix #3169. Insufficient detail when calculation fails due to cyclic reference.
2022-11-22 06:32:08 -08:00
MarkBaker 0244fb4fc8 Store StructuredReference object in the stack rather than simply the Structured Reference string, so that we don't have to create the object for both lexer and parser 2022-11-22 13:31:35 +01:00
Mark Baker a16ce29e2a Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-22 10:21:38 +01:00
oleibman 525384e573 Fix DocBlock in Style (#3200)
There is a DocBlock `@var ?array<string, array>` which causes PhpDocumentor to fail parsing Style/Style, so the online API documentation for that class is missing. Changing to `@var null|array<string, array>` fixes the problem.
2022-11-21 21:28:57 -08:00
oleibman 704a7b9fd1 Fix Unintential Deprecated Calls in Tests - LOOKUPREF (#3174)
* Fix Unintential Deprecated Calls in Tests - LOOKUPREF

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* One Intentional Deprecation

Annotate it.
2022-11-21 19:54:14 -08:00
oleibman 26e17277e1 Eliminate Some Scrutinizer 'Major' Problems Part 5 (#3161)
* Eliminate Some Scrutinizer 'Major' Problems Part 5

More of the same. 2 or 3 of these still to go after this.

Note one deprecation. Shared/Drawing has a method imagecreatefrombmp. However, that was introduced as a native PHP function with 7.2, so the method is no longer needed.

* More Silliness

Keep trying.

* If At First You Don't Succeed

Try, try again.
2022-11-21 15:31:13 -08:00
MarkBaker a7259de437 Explicitly prevent serialization of the Spreadsheet object 2022-11-22 00:12:09 +01:00
MarkBaker 8955859925 Update FAQ 2022-11-21 21:15:49 +01:00
Mark Baker b6f9ef17fe Merge pull request #3198 from PHPOffice/Github-CI_PHP-7.3-Issue
See if reintroducing PHP 7.3 in the matrix fixes the CI Workflow issue
2022-11-21 15:45:25 +01:00
MarkBaker 596a00bf69 This is going to be a real pain 2022-11-21 15:16:36 +01:00
MarkBaker 575a1efb2b Heaven only knows why the CI pipelines are complaining about a PHP 7.3 issue; all references to PHP 7.3 should have been removed from the workflows
Re-introducing 7.3 now, just to try and ensure that all checks pass, so that the 7.3 weirdness won't be a blocker for merging
2022-11-21 15:11:30 +01:00
Mark Baker 8b9b32d647 Merge pull request #3197 from PHPOffice/BugFix_Default-arguments-for-TEXTJOIN
Support null and empty values in TEXTJOIN()
2022-11-21 15:02:45 +01:00
MarkBaker 9f6bbd71b6 BugFix - Support null values in TEXTJOIN() text values as well as empty strings
Allow default values for TEXTJOIN() delimiter and ignore_empty... even though the official MS documentation lists them as required arguments, they are actually optional
2022-11-21 14:35:42 +01:00
Mark Baker f1be181858 Merge pull request #3194 from PHPOffice/ConditionalFormatting_Eliminate-duplicate-setter-code
Eliminate duplicate call to set Conditional Styles in the model when loading an Xls file
2022-11-20 21:59:59 +01:00
Mark Baker db1988e976 Merge branch 'master' into ConditionalFormatting_Eliminate-duplicate-setter-code 2022-11-20 21:47:18 +01:00
Mark Baker 1429999f0b Merge pull request #3193 from PHPOffice/Issue-2871_Merge-Cells-Bugfix-and-Performance
Eliminate call to getFormattedValue() when not required
2022-11-20 21:46:55 +01:00
MarkBaker bc3903a751 Eliminate call to getFormattedValue() when not required 2022-11-20 10:04:49 +01:00
fjohnston@avatarasoftware.com 66da98ebb8 Handle Currencies Stored as Strings in Formulas
Added a function to the new `FormattedNumber` helper that will use the currency code pulled from `localeconv` by `StringHelper::getCurrencyCode()`.  The currency code is `preg_quoted` and then dropped into a regexp that is modelled on the expression developed for `convertToNumberIfPercent`.  This will allow locale independent operation.
Unfortunately `localeconv` only provides information about standard currency formats and not accounting formats.  This means that we can't say for sure whether or not a locale has an accounting format where the currency symbol shows up in a non-standard position (eg. left justified for some countries instead of appearing directly in front of the value).  The regexp should handle these cases.

The primary issue with this approach is that the regexp will incorrectly match invalid currency formats for some locals as it checks for the symbol before and after the value.

A possible improvement would be to pull `p_cs_precedes` and `n_cs_precedes` from `localeconv` and using them to determine if the currency symbol should appear before or after the value for the current locale.  Since white-space is ignored by the regexp, accounting formats should still work, as long as the accounting format doesn't involve moving the symbol to the opposite side of the value.
2022-11-18 14:54:48 -05:00
MarkBaker 2e356821b3 Eliminate duplicate call to set Conditional Styles in the model when loading an Xls file 2022-11-18 10:41:22 +01:00
Adrien Crivelli 8f40b9841a Update GitHub Actions 2022-11-17 14:35:42 +01:00
Mark Baker 26cb1c1bcf Merge pull request #3163 from fox34/chart-write-y-axis-line-styles
Chart: Correctly handle axis line styles
2022-11-17 10:46:38 +01:00
MarkBaker 3e81da48f7 Initial parsing for Structured References 2022-11-15 20:00:36 +01:00
fox34 95d929441c Test different colors for different axis 2022-11-15 11:35:07 +01:00