PhpSpreadsheet/src/PhpSpreadsheet
oleibman 7517cdd008
Improve Coverage for CSV (#1475)
I believe that both CSV Reader and Writer are 100% covered now.

There were some errors uncovered during development.

The reader specifically permits encodings other than UTF-8 to be used.
However, fgetcsv will not properly handle other encodings.
I tried replacing it with fgets/iconv/strgetcsv, but that could not
handle line breaks within a cell, even for UTF-8.
This is, I'm sure, a very rare use case.
I eventually handled it by using php://memory to hold the translated
file contents for non-UTF8. There were no tests for this situation,
and now there are (probably too many).

"Contiguous" read was not handle correctly. There is a file
in samples which uses it. It was designed to read a large sheet,
and split it into three. The first sheet was corrrect, but the
second and third were almost entirely empty. This has been corrected,
and the sample code was adapted into a formal test with assertions
to confirm that it works as designed.

I made a minor documentation change. Unlike HTML, where you never
need a BOM because you can declare the encoding in the file,
a CSV with non-ASCII characters must explicitly include a BOM
for Excel to handle it correctly. This was explained in the Reading CSV
section, but was glossed over in the Writing CSV section, which I
have updated.
2020-05-17 18:15:18 +09:00
..
Calculation Remove @throws comment 2020-05-16 20:33:25 +09:00
Cell Remove @throws comment 2020-05-16 20:33:25 +09:00
Chart Remove @throws comment 2020-05-16 20:33:25 +09:00
Collection Remove @throws comment 2020-05-16 20:33:25 +09:00
Document PHPDoc: use @return $this for fluent methods 2020-03-02 19:11:00 +07:00
Helper Replace migration tool with RectorPHP 2020-05-02 12:34:50 +09:00
Reader Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
RichText Remove @throws comment 2020-05-16 20:33:25 +09:00
Shared Remove @throws comment 2020-05-16 20:33:25 +09:00
Style Remove @throws comment 2020-05-16 20:33:25 +09:00
Worksheet Remove @throws comment 2020-05-16 20:33:25 +09:00
Writer Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
Comment.php PHPDoc: use @return $this for fluent methods 2020-03-02 19:11:00 +07:00
DocumentGenerator.php Remove @throws comment 2020-05-16 20:33:25 +09:00
Exception.php Drop unused code and fix some PhpStorm warnings 2017-10-08 01:21:32 +09:00
HashTable.php Remove @throws comment 2020-05-16 20:33:25 +09:00
IComparable.php Remove boilerplates 2017-09-30 22:12:28 +09:00
IOFactory.php Remove @throws comment 2020-05-16 20:33:25 +09:00
NamedRange.php Remove @throws comment 2020-05-16 20:33:25 +09:00
ReferenceHelper.php Remove @throws comment 2020-05-16 20:33:25 +09:00
Settings.php Remove @throws comment 2020-05-16 20:33:25 +09:00
Spreadsheet.php Remove @throws comment 2020-05-16 20:33:25 +09:00