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

UTILS: Remove redundant check in Utils::getStatusCode() #30

Merged
merged 1 commit into from
Jul 23, 2022
Merged

UTILS: Remove redundant check in Utils::getStatusCode() #30

merged 1 commit into from
Jul 23, 2022

Conversation

sjokkateer
Copy link
Contributor

Signed-off-by: Remy Bos [email protected]

Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC no
QA yes/no

Description

This PR removes a redundant check in the conditional within the Utils::getStatusCode() method.

Within the body of Utils::getStatusCode() a call is made to ResponseInterface::getStatusCode(). This method is documented to return an integer. The only scenario where ! $status would evaluate to true is whenever a statuscode of 0 is returned. This case is also covered by the check $status < 400 and could therefore be safely removed.

A test case is added to demonstrate that the same resultant status code is obtained.

If there is anything I overlooked please let me know!

Add an additional test to demonstrate it behaving the same.

Signed-off-by: Remy Bos <[email protected]>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Ocramius Ocramius self-assigned this Jul 23, 2022
@Ocramius Ocramius added this to the 3.8.0 milestone Jul 23, 2022
@Ocramius Ocramius merged commit aa47a70 into laminas:3.8.x Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants