PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Gnumeric
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
..
GnumericFilter.php Improve Coverage for Gnumeric (#1517) 2020-06-19 20:34:02 +02:00
GnumericInfoTest.php Improve Coverage for Gnumeric (#1517) 2020-06-19 20:34:02 +02:00
GnumericLoadTest.php Gnumeric Better Namespace Handling (#2022) 2021-05-04 21:41:11 +02:00
GnumericStylesTest.php Improve Coverage for Gnumeric (#1517) 2020-06-19 20:34:02 +02:00
PageSetupTest.php Stricter visibility 2020-07-19 12:30:31 +09:00