Skip to content
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

Adapt to latest API changes #13

Merged
merged 2 commits into from
Nov 19, 2017
Merged

Conversation

OndraM
Copy link
Member

@OndraM OndraM commented Nov 16, 2017

Adapt to changes from Matej release on Wednesday evening .

https://jira.int.lmc.cz/browse/RAD-663
https://jira.int.lmc.cz/browse/RAD-662

@@ -30,7 +30,7 @@ private function transformResponseToException(RequestInterface $request, Respons
throw AuthorizationException::fromRequestAndResponse($request, $response);
}

if ($responseCode >= 401 && $responseCode < 600) {
if ($responseCode >= 400 && $responseCode < 600) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why not use the StatusCodeInterface:: STATUS_BAD_REQUEST?

Copy link
Member Author

@OndraM OndraM Nov 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it would actually lower the readability.

The condition is now explicitly read as "for all response codes between 400 and 600 do this".
Using the constant, it will look like:
"for all response codes between BAD_REQUEST and 600 do this". But this is not what the condition is intended for.

The constants IMO makes sense when comparing with specific response code, not with range of codes...

@OndraM OndraM merged commit 224c827 into lmc-eu:master Nov 19, 2017
@OndraM OndraM added this to the 0.9 milestone Nov 23, 2017
@OndraM OndraM deleted the feature/api-changes branch January 15, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants