PhpSpreadsheet/tests/PhpSpreadsheetTests/Cell
oleibman e4e99b8a73
Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121)
* Permit Date/Time Entered on Spreadsheet to be Calculated as Float

Fix #1416. I do not entirely understand the use case for this old issue, but resolving it seems straightforward. Issue complains that user-entered date/time fields may be interpreted as either float or int when PhpSpreadsheet reads them. Issue suggests getCalculatedValue treat all date/time fields as float; that seems like a breaking change. However, adding an option to permit it seems okay. That option might be implemented as either a property of Calculation, or a static property of Cell. Since the changed logic is found in Cell (and Shared/Date), I opted for the latter.

In Cell, the property `$parent` is incorrectly described in doc block as `Cells`, and should be `?Cells`. This change eliminates some Phpstan and Scrutinizer problems, and should allow the elimination of some try/catch blocks - I have not done an exhaustive search for those.

Calls to `isDateTime` could have affected activeSheet and selectedCells; they no longer can. Optional parameters are added to it and the functions it calls to accommodate the new functionality; the defaults for the new parameters will, of course, return the same result as the earlier versions of the functions would have returned.

* Scrutinizer - Self-inflicted

Tests used constant which I deprecated.
2022-10-18 18:58:38 -07:00
..
AddressHelperTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
AdvancedValueBinderTest.php Floating-point Equality in Two Tests (#3064) 2022-09-14 09:05:01 -07:00
CellAddressTest.php Initial work on deprecating `ByColumnAndRow` methods; and providing functionality to use the basic cellAddress methods to be used with a string cell address (e.g. `C5`); an array of columnId and rowId (e.g. `[3, 5]`) or a new CellAddress object. 2022-03-31 23:22:48 +02:00
CellDetachTest.php Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
CellRangeTest.php Add functionality to adjust CellRange by "modifying" the from/to CellAddress Value objects 2022-04-01 15:41:55 +02:00
CellTest.php Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
ColumnRangeTest.php Add functionality to shift RowRange and ColumnRange 2022-04-01 11:26:47 +02:00
CoordinateTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
DataTypeTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
DataValidationTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
DataValidator2Test.php Data Validations Referencing Another Sheet (#2265) 2021-08-24 08:58:38 -07:00
DataValidatorTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
DefaultValueBinderTest.php Update Some Doc Block Annotations (#2351) 2021-11-11 23:38:05 -08:00
HyperlinkTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
RowRangeTest.php Add functionality to shift RowRange and ColumnRange 2022-04-01 11:26:47 +02:00
StringValueBinderTest.php Update Some Doc Block Annotations (#2351) 2021-11-11 23:38:05 -08:00
ValueBinderWithOverriddenDataTypeForValue.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00