PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation
oleibman 66695881e4
Calculation suppressFormulaErrors - Minor Break and Deprecation (#3092)
Fix #1531. This is a replacement for PR #3081 (see last paragraph below), which I will close.

Calculation has a property `suppressFormulaErrors`, which really doesn't work as one might expect. If a calculation throws an exception, the setting of this property might prevent the Exception from being thrown, but it will still trigger an Error. I do not think this makes sense, and will change it so the calculation will return `false`, which is part of the original design but which would essentially never happen. This allows the user to save a corrupt spreadsheet, but this was already possible through the use of `setPreCalculateFormulas(false)` on the Writer, so this doesn't really open any new exposures. It nevertheless might be considered a breaking change because of the difference in behavior.

Deprecation - the visibility of the existing property is public, which means it can be changed directly. A new private property is added with a public setter/getter. The new property will be used when the existing property is null (default), which will allow the existing property to be deprecated.

Function getFunctions is changed to static - the array which it returns is static. Existing callers using it as non-static will still function correctly.

Although I am enabling this ability, I don't necessarily think it's a good idea to make use of it. See the original issue for a discussion of why. It is not mentioned in the official documentation, and I will not be adding documentation for it. The originator discovered it by reading the code, and I think that is sufficient for what will often be an ill-advised choice.

Many of the large number of problems with Calculation.php in phpstan baseline are addressed. PR 3081 ran afoul of something in phpstan. The changes in this ticket are more limited, adding a number of doc blocks but leaving executable code unchanged.
2022-10-01 08:40:27 -07:00
..
Engine Handle defined names with the range operator. 2022-04-13 17:55:51 +02:00
Functions Cleanup 3 LookupRef Tests (#3097) 2022-10-01 07:05:54 -07:00
ArrayFormulaTest.php Convert all relevant Logical functions to support array arguments (#2600) 2022-02-18 02:56:23 +01:00
ArrayTest.php Fully flatten an array (#2956) 2022-07-27 19:29:02 -07:00
BinaryComparisonTest.php Extract some methods from the Calculation Engine into dedicated classes (#2537) 2022-02-04 16:02:29 +01:00
CalculationErrorTest.php Calculation suppressFormulaErrors - Minor Break and Deprecation (#3092) 2022-10-01 08:40:27 -07:00
CalculationFunctionListTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
CalculationLoggingTest.php Unit test for the Calculation Engine debug log 2022-03-06 09:47:17 +01:00
CalculationSettingsTest.php Adjust Cell Reference regexp in Calculation Engine to handle worksheet names containing quotes (#2617) 2022-02-22 15:55:59 +01:00
CalculationTest.php Adjust Cell Reference regexp in Calculation Engine to handle worksheet names containing quotes (#2617) 2022-02-22 15:55:59 +01:00
DefinedNameConfusedForCellTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
DefinedNamesCalculationTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
FormulaAsStringTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
FormulaParserTest.php Phpstan and Xlsx Reader (#3043) 2022-09-04 10:43:31 -07:00
FunctionsTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
MergedCellTest.php Relax validation on merge cells to allow input of a single cell 2022-06-10 01:15:57 +02:00
NullEqualsZeroTest.php Add Test For NULL=0 (#2607) 2022-02-19 13:12:44 -08:00
ParseFormulaTest.php Escape double quotes in worksheet names for column range and row range references 2022-06-17 13:34:20 +02:00
RefErrorTest.php Handling of #REF! Errors in Subtotal, and More (#2902) 2022-06-25 22:08:32 -07:00
RowColumnReferenceTest.php Set precision for Database function unit tests, for RowColumnReference and Dimension Helper unit tests (#2604) 2022-02-18 21:37:26 +01:00
StringLengthTest.php Keep Calculated String Results Below 32K (#2921) 2022-07-04 08:30:46 -07:00
TranslationTest.php R1C1 Format and Internationalization, plus Relative Offsets (#3052) 2022-09-16 08:25:26 -07:00
XlfnFunctionsTest.php Correct Namespaces in 11 Tests (#3020) 2022-08-20 19:58:43 -07:00