laminas / laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines
https://docs.laminas.dev/laminas-stratigility/
BSD 3-Clause "New" or "Revised" License
55 stars 12 forks source link

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

Closed sjokkateer closed 2 years ago

sjokkateer commented 2 years ago

Signed-off-by: Remy Bos 27890746+sjokkateer@users.noreply.github.com

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!