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   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A verifyResponse() 0 11 2
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