PhpSpreadsheet/samples
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
..
Autofilter Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
Basic Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
Calculations Phpstan Baseline Fixes 2022-09-21 (#3080) 2022-09-30 09:00:13 -07:00
Chart Memory Leak in Sample35 (#3062) 2022-09-14 10:12:53 -07:00
ConditionalFormatting Handle the case of an invalid formula by defaulting to ptgInt + 0, which will avoid breaking the file 2022-03-13 10:53:07 +01:00
DefinedNames Make DefinedNames Samples Consistent With Other Samples (#1707) 2020-11-11 11:02:04 +01:00
Pdf Minor Changes for Mpdf, Dompdf (#3002) 2022-08-13 18:28:22 -07:00
Reader Scrutinizer Clean Up Tests (#3061) 2022-09-14 07:11:20 -07:00
Reading_workbook_data Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00
Table AutoFilter inside Tables 2022-05-29 19:38:43 +05:30
bootstrap Update Jquery to V3.6 2021-11-24 09:12:46 +09:00
images Special Characters in Image File Name (#2416) 2021-12-06 06:50:09 -08:00
templates Additional Properties for Trendlines (#3028) 2022-08-27 22:59:35 -07:00
Bootstrap.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
Header.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
favicon.ico Update Jquery to V3.6 2021-11-24 09:12:46 +09:00
index.php Drop PHP 7.2 2021-11-01 12:01:54 +09:00