PhpSpreadsheet/docs/topics
Owen Leibman ae80c12ef0 CSV Reader Enhancements
This PR came about as I pondered how feasible it was to change the default escape character from backslash to null string, since the latter emulates Excel's own actions. Also, surveying issues relating to CSV, it seems that people are often in a situation where the current defaults aren't optimal for them (e.g. they are in a region where semicolon rather than comma is a better default delimiter). My case and that case can both be handled by methods after a reader is constructed. However, the issues also show that many use `IOFactory::load` rather than `new Csv()`, and the methods to affect the defaults are not available in that case.

Adding a static callback that can be invoked by the constructor addresses all these problems. This can be set as part of the user application's normal initialization, and no special attention needs to be paid to CSV loads thereafter, no matter how they are invoked.

This also makes it feasible to use 'guess' as inputEncoding, by providing a new setFallbackEncoding (default CP1252) method to use if none of the heuristic tests pass. There was already the ability to guess the encoding before `$reader->load()`, but not before `IOFactory::load`.

Almost all typehints in Reader/Csv and Reader/Csv/Delimiter are now part of the function signature rather than in the DocBlock. The exceptions are one method in Delimiter which uses a `resource` parameter, and the `canRead` and `load` methods, which must match the signature in IOFactory. I will look into changing those later.

The Csv Reader tests are moved into their own directory. All Phpstan baseline entries involving Csv Reader are eliminated.
2021-05-16 06:05:02 -07:00
..
images Support DataBar of conditional formatting rule (#1754) 2021-01-29 16:57:40 +01:00
accessing-cells.md Apply Column and Row Styles to Existing Cells (#1721) 2020-12-10 18:19:56 +01:00
architecture.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
autofilters.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
calculation-engine.md Updating a misspelling of a function name. (#1695) 2020-11-01 12:05:04 +01:00
creating-spreadsheet.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
defined-names.md Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
file-formats.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
memory_saving.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
migration-from-PHPExcel.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
reading-and-writing-to-file.md CSV Reader Enhancements 2021-05-16 06:05:02 -07:00
reading-files.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
recipes.md Support DataBar of conditional formatting rule (#1754) 2021-01-29 16:57:40 +01:00
settings.md WEBSERVICE is HTTP client agnostic 2020-07-19 11:33:01 +09:00
worksheets.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00