Passed
Push — master ( 7cd6c5...dd963e )
by Laurens
04:05
created

Handler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleRequestException() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Werkspot\KvkApi\Http\Adapter\Guzzle\Exception;
6
7
use GuzzleHttp\Exception\RequestException;
8
use Werkspot\KvkApi\Exception\KvkApiException;
9
10
final class Handler
11
{
12 5
    public static function handleRequestException(RequestException $exception): void
13
    {
14 5
        switch ($exception->getCode()) {
15 5
            case 404:
16 3
                throw new NotFoundException();
17
        }
18
19 2
        throw new KvkApiException($exception->getMessage());
20
    }
21
}
22