ResponseHelper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 9
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasErrorStatusCode() 0 3 1
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Helpers;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
class ResponseHelper
8
{
9
    /**
10
     * Did the request return a 4xx or 5xx status code?
11
     * Note: Also handles 3xx redirect codes as errors atm.
12
     */
13 10
    public static function hasErrorStatusCode(ResponseInterface $response): bool
14
    {
15 10
        return $response->getStatusCode() > 299;
16
    }
17
}
18