Christian Bläul
823f51c4f0
Added PHPUnit test to save without header
2018-02-02 11:13:49 +01:00
Christian Bläul
488b8f9d9b
Prevent an "Uninitialized string offset" error
...
Got triggered by testMissingEndingLineBreak.
2018-02-02 11:13:49 +01:00
Christian Bläul
b004911218
$this->auto_non_chars didn't work the way I would have expected:
...
The "-" was taken literally, and thus 0 was forbidden, but 1 was allowed.
Fixes #55 .
Also see #61
2018-02-02 11:13:49 +01:00
Christian Bläul
47f691ce33
Added new testSingleColumnWithZeros.
...
Proves that issue #61 is indeed fixed.
2018-02-02 11:13:49 +01:00
Christian Bläul
ab6b3d19e0
Added line to send people to the other examples within the repo.
2018-02-02 11:13:49 +01:00
Christian Bläul
2d7ab4b2f0
Added documentation to parse_string()
...
Fixes #76
2018-02-02 11:13:49 +01:00
Christian Bläul
2bf4a2d0cd
Added reference to RFC 4180 to make the goal of this project a little clearer.
...
Fixes #64
2018-02-02 11:13:49 +01:00
Christian Bläul
f41a18b1c0
Added support for DOS double line endings
...
Fixed GitHub issue #75
2018-02-02 11:13:49 +01:00
Christian Bläul
003e98e8ff
Added SaveTest for coverage of writing files
2018-02-02 11:13:49 +01:00
Christian Bläul
d8aefa792e
Made PhpStorm inspections happy:
...
- avoid empty for-loop bodies as they are unusual and look a bit like
forgotten implementations
- removed 'i' modifier from regular expressions that contain no letters
- replaced consecutive 'str_replace' calls by single 'strtr' call
- introduced new variable $is_newline to make the intend of a complex
'if' more obvious and get rid of the operator precedence inspection
2018-02-02 11:13:49 +01:00
Christian Bläul
a92506d078
Prevent quoting of sinlge-column file. Needed because auto() with...
...
...single-column file will not set field delimiter. This commit is a bug fix.
For a test see testSaveWithDefaultSettings.
2018-02-02 11:13:49 +01:00
Christian Bläul
54e846ee30
Construct array key just once instead for better readability
2018-02-02 11:13:49 +01:00
Christian Bläul
63932f67a4
ParseTest: skip 'test_Piwik_data' in PHP 5.4
2018-02-02 11:13:49 +01:00
Christian Bläul
44ff705a23
Improved README.md: spelling, mention native PHP functions
2018-02-02 11:13:49 +01:00
Christian Bläul
6432ba2ced
Added test for new field 'use_mb_convert_encoding'
2018-02-02 11:13:49 +01:00
Christian Bläul
8ae09c604b
Added support for mb_convert_encoding() instead of iconv()
...
See issue #109 at GitHub
2018-02-02 11:13:49 +01:00
Christian Bläul
5ea1d95f31
Also run test files ending with Test.php (capital letter)
2018-02-02 11:13:49 +01:00
Christian Bläul
af549dc47e
Updated .travis.yml to test with PHP 7.2
2018-02-02 11:13:49 +01:00
Christian Bläul
12aec86bf7
Merge branch 'alex-vlasov-single_quote_auto_detection'
...
See #74
2018-01-21 21:48:13 +01:00
Christian Bläul
38944ba221
Moved testAutoQuotes into existing test infrastructure
2018-01-21 21:47:28 +01:00
Alexander Vlasov
5a9a10aeed
Incorrect parsing with single quote during auto-detection delimiter.
2018-01-21 21:43:42 +01:00
Christian Bläul
631fae5191
Improved PHPDoc of _check_count; Refactored vars in _guess_delimiter
...
This commit does not contain functional changes.
2018-01-21 01:15:56 +01:00
Christian Bläul
18ddde98c0
Comparison in _enclose_value: put least expensive condition first
2018-01-21 01:15:56 +01:00
Christian Bläul
a07de14bba
Slightly more meaningful variable names in 'unparse' function
2018-01-21 01:15:56 +01:00
Christian Bläul
e87a5ae0e6
Improved source code formatting (no functional change)
2018-01-21 01:15:56 +01:00
Christian Bläul
c04fc89c43
Removed @access PHPDoc because it doesn't add value.
...
Today's phpDocumentor detects visiblity from the PHP keywords.
2018-01-21 01:15:56 +01:00
Christian Bläul
cc908fd096
_detect_and_remove_sep_row_from_data: improved comments to make it more ...
...
obvious that $data given is changed.
2018-01-21 01:15:56 +01:00
Christian Bläul
155c50ad7a
Slightly improved code quality, no functionality changes
...
E.g.:
- Improved PHPDoc to reflect/include actual types
- Removed unnecessary brackets in ternary statements
- _check_count: Added return statement (code smell)
- added type-safe comparison where it doesn't change results
2018-01-21 01:15:56 +01:00
Christian Bläul
98edcbfec3
Ignore *.bak files that WinMerge leaves behind
...
I don't want to accidentally add them to the repo.
2018-01-21 01:15:56 +01:00
Christian Bläul
378353eb79
Added PHIVE files to .gitignore
2018-01-21 01:15:56 +01:00
Christian Bläul
e4ca0062f6
Added .idea folder to .gitignore; if you want my PHPStorm settings, go ...
...
...to GitHub issue #101 : https://github.com/parsecsv/parsecsv-for-php/issues/101
2018-01-21 01:15:56 +01:00
Christian Bläul
e419663679
Improved name of files and classes within tests/methods folder
...
This follows PHP best practices for classes.
2018-01-21 01:15:56 +01:00
Christian Bläul
0ecaa80222
Added .editorconfig to tell others about spaces and tabs
...
Also:
- formated source code according to these rules;
- added spaces after commas in test code
See GitHub issue #101
2017-12-21 09:33:23 +01:00
Christian Bläul
0ac5064d58
Only call iconv if input and output encoding differ.
...
This saves some headache if characters are invalid according to iconv.
2017-12-21 09:33:23 +01:00
Christian Bläul
4d011827f5
When we find a BOM, we know the input encoding. Let's use it!
...
Also: UTF tests not failing anymore because we are specifying
the output encoding now.
2017-12-21 09:33:23 +01:00
Christian Bläul
c818fff81a
Only improved spelling in source code comments
2017-12-21 09:33:23 +01:00
Matthew de Marillac
ccad5c8360
Remove BOM from UTF files.
...
Implementation similar to suggestion from, and thus closes #83
2017-12-21 09:33:23 +01:00
Christian Bläul
b082849b17
Added tests for files starting with a byte order mark (BOM)
2017-12-21 09:33:23 +01:00
Christian Bläul
7536d55f27
PHPUnit: Prevent 'Cannot redeclare class' error
...
The Travis environments of PHP 5.4 and 5.6 contained both the
namespaced and the global version of the TestCase class :-/
2017-12-06 02:25:54 +01:00
Christian Bläul
db1e242d07
PHPUnit: made compatible with v6, which is now namespaced.
2017-12-06 02:25:54 +01:00
Christian Bläul
fd5fb96bce
PHPUnit: simplified Bootstrap.php without changing functionality.
...
Notes:
- Using / on Windows is safe.
- __DIR__ is identical to dirname(__FILE)
2017-12-06 02:25:54 +01:00
Christian Bläul
4f08cbb561
PHPUnit: added test for UTF-8 and sep= row
...
Thanks to https://github.com/blaubaer ! Some things in the CSV file
originate from java-kata-1 by Gregor Noczinski
2017-12-06 02:25:54 +01:00
Christian Bläul
0d14ca01be
Improved sep= detection and added it to auto()
2017-12-06 02:25:54 +01:00
Christian Bläul
a4a0dfa2fd
Extracted the long detection algorithm from 'auto()' into new function.
...
Also removed unnecessary brackets () in ternary on the way.
2017-12-06 02:25:54 +01:00
Christian Bläul
95ad7c315a
PHPUnit: told Travis to also run tests on PHP 7
2017-12-06 02:25:54 +01:00
Christian Bläul
0e50aec3b9
Renamed example file 'single_row', as it containes a single column.
2017-12-06 02:25:54 +01:00
Christian Bläul
f5851ba9ac
Only improved comments in source code
2017-12-06 02:25:54 +01:00
Jan Piskvor Martinec
fad5ebcdc8
Added function to detect delimiter using sep= file header
2017-12-06 02:25:54 +01:00
Christian Bläul
bd2031582d
Added 'single_row' test data for issue #99
...
Took example documented in #100 . Thanks, @tunecino!
2017-11-16 15:29:17 +01:00
Christian Bläul
1db4b02e9e
ChangeLog: corrected spelling mistake
2017-11-16 15:29:17 +01:00