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

ClientFactory::getClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 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