PhpSpreadsheet/tests/PhpSpreadsheetTests/Shared
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
..
Trend Floating-point Equality in Two Tests (#3064) 2022-09-14 09:05:01 -07:00
CodePageTest.php Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen (#2213) 2021-07-12 03:02:47 +02:00
Date2Test.php Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
DateTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
DrawingTest.php Html import dimension conversions (#2152) 2021-06-11 17:29:49 +02:00
FileTest.php Minor Changes for Cygwin (#3070) 2022-09-17 07:32:12 -07:00
Font2Test.php Improve Coverage for Shared/Font (#2961) 2022-07-29 07:11:37 -07:00
Font3Test.php Improve Coverage for Shared/Font (#2961) 2022-07-29 07:11:37 -07:00
FontTest.php Floating-point Equality in Two Tests (#3064) 2022-09-14 09:05:01 -07:00
OLEReadTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
PasswordHasherTest.php Scrutinizer Clean Up Tests (#3061) 2022-09-14 07:11:20 -07:00
PasswordReloadTest.php Fix SettingsTest 2021-06-30 11:33:35 -07:00
StringHelperInvalidCharTest.php Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910) 2022-07-02 08:53:39 -07:00
StringHelperTest.php Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910) 2022-07-02 08:53:39 -07:00
TimeZoneTest.php Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00