GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 01c09f...8bb018 )
by Lanre
08:01
created

VerifyHttpStatusResponseCode::verifyResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Gbowo\Adapter\Paystack\Traits;
4
5
use Gbowo\Exception\InvalidHttpResponseException;
6
use Psr\Http\Message\ResponseInterface;
7
8
trait VerifyHttpStatusResponseCode
9
{
10
11
    protected function verifyResponse(ResponseInterface $response)
12
    {
13
        if(in_array($response->getStatusCode(), [200, 201])) {
14
            //https://developers.paystack.co/v1.0/docs/errors
15
            return;
16
        }
17
18
        throw new InvalidHttpResponseException(
19
          "Invalid HTTP response. Expected 200 or 201 but got {$response->getStatusCode()}"
20
        );
21
    }
22
}
23