Commit Graph

239 Commits

Author SHA1 Message Date
susgo
91091ac933 Merge pull request #2 from itexia/new-enom-datatype
init enum for data type
2018-02-19 12:08:38 +01:00
susgo
2c7c552515 Update DatatypeTrait.php 2018-02-19 12:07:32 +01:00
Susann Sgorzaly
52e87953a4 corrected datatype count 2018-02-19 12:02:48 +01:00
Susann Sgorzaly
48cec20f4f namespace change 2018-02-18 12:45:33 +01:00
Susann Sgorzaly
c266ef9fbc Merge branch 'introduce-namespaces' of https://github.com/itexia/parsecsv-for-php into new-enom-datatype 2018-02-18 12:43:45 +01:00
Susann Sgorzaly
76a0406eff updated examples for using new classname 2018-02-18 12:43:19 +01:00
Susann Sgorzaly
17ac1dee1a renamed namespace 2018-02-18 12:42:53 +01:00
Susann Sgorzaly
f6bd414ae7 init enum for data type 2018-02-18 00:09:22 +01:00
Susann Sgorzaly
a7a0bc34a4 init introduce namespaces 2018-02-17 23:41:03 +01:00
Susann Sgorzaly
0e5afb209e test for method getDatatypes added 2018-02-17 22:24:50 +01:00
Susann Sgorzaly
f8c68a6cd7 test improvements 2018-02-17 22:24:19 +01:00
Susann Sgorzaly
5babb55879 review changes 2018-02-14 14:03:00 +01:00
Susann Sgorzaly
8ec87126dc load files from extensions folder for tests; added new property in worthless_test 2018-02-14 12:12:53 +01:00
Susann Sgorzaly
d788135bbe exclude datatype detection in its own trait 2018-02-14 12:12:01 +01:00
Susann Sgorzaly
301f6da3e6 init new functionality to identify datatypes of columns 2018-02-13 17:18:01 +01:00
Christian Bläul
b9721a9aff Slightly improved PHPDoc comments 2018-02-02 11:13:49 +01:00
Christian Bläul
3c31b70724 Added accidentally removed regex modifier i 2018-02-02 11:13:49 +01:00
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