IproApiResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A onlySuccessful() 0 5 1
1
<?php
2
3
namespace LaravelIproSoftwareApi;
4
5
use Illuminate\Http\Client\Response;
6
use LaravelIproSoftwareApi\Exceptions\UnexpectedApiResponseException;
7
8
class IproApiResponse extends Response
9
{
10
    public function onlySuccessful(): static
11
    {
12
        throw_if(!$this->successful(), new UnexpectedApiResponseException($this));
13
14
        return $this;
15
    }
16
}
17