-
Notifications
You must be signed in to change notification settings - Fork 182
Return false
from AbstractApi::get()
on empty response body
#275
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
the CI is broken, could you try to fix it? |
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.
This PR will fix the BC break. Thank you 👍
To fix the tests we also have to fix the expected return type in IssueRelation.php, see
https://github.com/kbsali/php-redmine-api/blob/v1.8.0/src/Redmine/Api/IssueRelation.php#L45
- if (null === $ret) {
+ if (false === $ret) {
Also please see the requested changes.
src/Redmine/Api/AbstractApi.php
Outdated
@@ -42,7 +42,7 @@ public function lastCallFailed() | |||
* @param string $path | |||
* @param bool $decodeIfJson | |||
* | |||
* @return string|array|SimpleXMLElement|null | |||
* @return string|array|SimpleXMLElement|false|null |
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.
Please remove the |null
because this will never be the case.
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.
json_decode()
is able to return null
if the decoded string is "null", but I think the API response will never print that.
Ref: https://3v4l.org/8sXS6.
I saw that condition, that's in part why I couldn't spend more time in this PR yet. |
To be honest I have not deeply dived into the AbstractApi.php. With #257 I moved the parsing functionality from |
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.
Should I update the CHANGELOG explaining this change or it is updated when releasing?
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.
I will do it before releasing v1.8.1. Thank you. |
Thanks @phansys ! 👍 |
@kbsali Can you please merge this? Or can I do it? |
sure, go ahead! :) |
Fixes #274.