PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader
Owen Leibman ecb4a7fe27 DocBlock Changes for Chart/Title
This is a leftover Scrutinizer change, but it needed more attention than most others. Chart/Title DocBlocks define caption as `null|string`. However, in the wild, Excel usually presents the caption as an array, and not an array of strings but rather of RichText items. I am not sure why an array is needed since a RichText item can contain many text runs, but things are what they are.

Reader/Xlsx/ChartTitleTest reads a spreadsheet with the captions stored as a RichText array. Since it performs array operations on something the DocBlock says cannot be an array, Scrutinizer objects, although not seriously enough to fail the module. Phpstan also objects; its objection is silenced with an annotation. Aside from this test, there are other tests which do set the caption to a string, and Excel seems to handle that without a problem. So, I have changed the DocBlock to specify `array|RichText|String`. I have dropped null as a possibility; nullstring will do equally well.

Because getCaption can now return multiple datatypes, I think a new function which can return the text portion of the entire caption as a single string is needed. I have added it. This simplifies the test named above, and some code in Writer/Html. The latter is not part of unit testing because the version of JpGraph found in Composer is too antiquated. I verified the Html change manually by running samples/Chart/32_Chart_read_write_HTML.php using a recent version of JpGraph. It was as a result of this test that I uncovered issue #2203. I did not see anything about Charts in docs, so did not add a description of the new function there.

Phpstan is happy with the changes. We'll see how Scrutinizer feels when I push it.
2021-07-02 14:33:43 -07:00
..
Csv Update CsvContiguousTest.php 2021-05-16 11:48:12 -07:00
Gnumeric Gnumeric Reader - Distinguish Created and Modified Timestamps (#2133) 2021-05-31 10:24:37 +02:00
Html Html import dimension conversions (#2152) 2021-06-11 17:29:49 +02:00
Ods Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00
Security Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Utility When image source is a URL, store the URL for use during extraction. (#2072) 2021-06-24 10:50:44 +02:00
Xls Fix for the BIFF-8 Xls colour mappings in the Reader (#2156) 2021-06-13 21:46:49 +02:00
Xlsx DocBlock Changes for Chart/Title 2021-07-02 14:33:43 -07:00
Xml Reader XML Properties - Eliminate strtotime (#2134) 2021-05-31 11:04:07 +02:00
SlkTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
XlsTest.php Fix for bug #1592 (UPDATED) (#1623) 2020-12-17 19:41:07 +01:00