PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader
oleibman 4be9366722
Gnumeric Better Namespace Handling (#2022)
* Gnumeric Better Namespace Handling

There have been a number of issues concerning the handling of legitimate but unexpected namespace prefixes in Xlsx spreadsheets created by software other than Excel and PhpSpreadsheet/PhpExcel.I have studied them, but, till now, have not had a good idea on how to act on them. A recent comment https://github.com/PHPOffice/PhpSpreadsheet/issues/860#issuecomment-824926224 in issue #860 by @IMSoP has triggered an idea about how to proceed.

Although the issues exclusively concern Xlsx format, I am starting out by dealing with Gnumeric. It is simpler and smaller than Xlsx, and, more important, already has a test for an unexpected prefix, since, at some point, it changed its generic prefix from gmr to gnm. I added support and a test for that some time ago, but almost certainly not in the best possible manner. The code as changed for this PR seems simpler and less kludgey, both for that exceptional case as well as for normal handling.

My hope is that this change can be a template for similar Reader changes for Xml, Ods, and, especially, Xlsx.

All grandfathered Phpstan issues with Gnumeric are fixed and eliminated from baseline as part of this change.

* Namespace Handling using XMLReader

Adopt a suggestion from @IMSoP affecting listWorkSheetInfo, which uses XMLReader rather than SimpleXML for its processing.

* Update GnumericLoadTest.php

PR #2024 was pushed last night, causing a Phpstan problem with this member.

* Update Gnumeric.php

Suggestions from Mark Baker - strict equality test, more descriptive variable names.
2021-05-04 21:41:11 +02:00
..
Gnumeric Gnumeric Better Namespace Handling (#2022) 2021-05-04 21:41:11 +02:00
Html Fix for Issue 2029 (Invalid Cell Coordinate A-1) (#2032) 2021-04-29 22:59:01 +02:00
Ods Ods defined names unit tests (#2054) 2021-05-03 08:39:42 +02:00
Security Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Xls Stricter visibility 2020-07-19 12:30:31 +09:00
Xlsx Pattern Fill style should default to 'solid' if there is a pattern fill with colour but no style (#2050) 2021-04-30 20:05:45 +02:00
Xml Extract Property and Style readers from the XML Reader into separate classes (#2009) 2021-04-20 15:27:44 +02:00
CondNumFmtTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
CsvContiguousFilter.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
CsvContiguousTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
CsvTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
OddColumnReadFilter.php Fix column names if read filter calls in XLSX reader skip columns 2018-12-10 20:00:26 +11:00
SheetsXlsxChartTest.php Fix/sheets xlsx chart (#1761) 2021-01-31 18:53:54 +01: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
Xlsx2Test.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
XlsxTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00