-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SplFileObject Flags have no effect / empty lines cannot be ignored #99
Comments
Hi @paslandau, I've just looked at your code and after some digging I've found the bug ... I'll release a patch version tomorrow. |
I've push the bug fix in the master repo. So if you download the master branch you can test your code against a patch version. The 7.0.1 behaviour is the correct one. Tell me if all is good for you. |
Hey @nyamsprod, For the sake of completeness, here's the dev-master output of the script in the op.
The output is identical to v7.0.1. My tests are currently part of my utility package for file based operations (tests are over here) and somewhat deeply integrated. But I'll check if parts of them can be extracted to extend the current league/csv test suite. |
version 7.1.1 is released which correct this bug |
Great, thx! |
@paslandau I have a question regarding League\Csv |
Hey @nyamsprod Depends.. SemVer states that the "public API must not change within a patch/minor release". Did you specifiy the exact behaviour anywhere in the docs? If not, a patch might be okay - on the other hand, that might be a missing piece in the docs :) I personally would bump up the major version because it might unexpectedly break existing code. Cheers |
@paslandau |
I just updated from 7.0.1 to 7.1.0 and noticed that my internal tests failed due to a
null
value appended at the end of each CSV file that was imported. After some trial and error I figured that theSplFileObject
falgs don't seem to have an effect any longer.I'm missing the
SplFileObject::SKIP_EMPTY
flag in particular since it seemed to make sure that there's nonull
value at the end if the file terminates on a new line.See the following test script:
Output in 7.0.1
Please note the lines with
SplFileObject::SKIP_EMPTY
set: Those contain only 2 values (as expected).Output in 7.1.0
Regardless of the flags, the output is always the same (3 lines, last one is
null
. I tried to figure out what was changed between those version but was unable to identify the cause - so this is my last desperate attempt to understand what's going on :)The text was updated successfully, but these errors were encountered: