Files
PhpSpreadsheet/samples/Basic
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
..
2018-01-28 15:59:38 +09:00
2018-01-28 15:59:38 +09:00
2017-10-01 17:48:59 +09:00
2018-01-28 15:59:38 +09:00
2020-07-26 14:13:11 +09:00
2017-10-01 17:48:59 +09:00
2017-10-01 17:48:59 +09:00
2020-05-18 12:43:18 +09:00
2020-06-09 00:22:22 -07:00
2021-05-09 15:41:36 -07:00
2017-10-01 17:48:59 +09:00
2017-10-01 17:48:59 +09:00
2020-05-18 13:49:57 +09:00
2022-07-29 06:14:28 -07:00
2017-10-01 17:48:59 +09:00
2020-05-18 13:49:57 +09:00
2022-03-09 18:55:31 -08:00
2017-10-01 17:48:59 +09:00
2017-10-01 17:48:59 +09:00