Passed
Push — master ( 720460...9d9d12 )
by Laurens
02:10
created

ClientFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 18
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getClient() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Werkspot\KvkApi;
6
7
use Werkspot\KvkApi\Client\Adapter\AdapterInterface;
8
use Werkspot\KvkApi\Client\Builder\Profile\Company\AddressBuilder;
9
use Werkspot\KvkApi\Client\Builder\Profile\Company\BusinessActivityBuilder;
10
use Werkspot\KvkApi\Client\Builder\Profile\Company\TradeNamesBuilder;
11
use Werkspot\KvkApi\Client\Builder\Profile\CompanyBuilder;
12
use Werkspot\KvkApi\Client\Builder\ProfileResponseBuilder;
13
14
final class ClientFactory
15
{
16 18
    public static function getClient(AdapterInterface $adapter): Client
17
    {
18 18
        $profileResponseBuilder =  new ProfileResponseBuilder(
19 18
            new CompanyBuilder(
20 18
                new TradeNamesBuilder(),
21 18
                new BusinessActivityBuilder(),
22 18
                new AddressBuilder()
23
            )
24
        );
25
26 18
        return new Client(
27 18
            $adapter,
28 18
            $profileResponseBuilder
29
        );
30
    }
31
}
32