-
Notifications
You must be signed in to change notification settings - Fork 77
[2.1] Throw exception when empty inputs found #166
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
Conversation
DescriptionIn one of the scenario, its been found that Let me know if this changeset looks ok or not. |
DeepDiver1975
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THX @sharidas
Can I ask you to add unit tests which test this behavior - and if possible show the infinite loop if the change is not applied?
THX
|
I think this is a good report, but aside from having a test I have 2 additional issues with this:
|
5e8cc71 to
dafbdf6
Compare
Codecov Report
@@ Coverage Diff @@
## 2.1 #166 +/- ##
============================================
+ Coverage 97.49% 97.51% +0.02%
- Complexity 112 114 +2
============================================
Files 13 13
Lines 439 443 +4
============================================
+ Hits 428 432 +4
Misses 11 11
Continue to review full report at Codecov.
|
|
I have updated the unit test for this change. I have made a minor change to the previous version:
The problem I see when handling this issue with the Reader class is, that the details when parsed would become empty for the https://github.com/sabre-io/xml/blob/2.1/lib/Reader.php#L63. Any pointers here how to handle it from the Reader, would be appreciated. Infact its a better approach. Regarding how the infinite loop can happen:
Now when the test is run, the code from method |
dafbdf6 to
7ccf4e3
Compare
|
@DeepDiver1975 @evert any suggestion on #166 (comment)? |
evert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable, I'm good with this approach
|
fine for me as well - please make sure prettyci and travis are green and we can merge. Please also have a look if these fixes need to be applied to other branches as well - mainly master. |
24c33a3 to
b26819d
Compare
|
While adjusting the changes for the tests, I have removed the travis configuration for php 7.0. There is an issue noticed with the syntax, incompatible. It was throwing error with the current change in php 7.0.
Yes thes changes can be applied to the master branch as well. Regarding PrettyCI, there are lot of issues popped up. And many of them are out changes which are not caused due to this PR. I was wondering if we could take it as a separate pr to make prettyCI green. |
|
I will take Care from Here on. Thx so far 👍 |
b26819d to
7ccf4e3
Compare
|
|
@sharidas please rebase to get ci green - THX |
d7a613c to
f2a1b7d
Compare
When input retrieved from stream_get_contents is empty string, then it would be safe to throw exceptions from the parse and expect methods. Signed-off-by: Sujith H <[email protected]>
f2a1b7d to
1c90dcc
Compare
Done. The CI is green now. |
When input retrieved from stream_get_contents
is empty string, then it would be safe to return
from the parse and expect methods.
Signed-off-by: Sujith H [email protected]