Client   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SergeyNezbritskiy\NovaPoshta;
6
7
use GuzzleHttp\Client as HttpClient;
8
use SergeyNezbritskiy\NovaPoshta\Models\Address;
9
use SergeyNezbritskiy\NovaPoshta\Models\Common;
10
use SergeyNezbritskiy\NovaPoshta\Models\ContactPerson;
11
use SergeyNezbritskiy\NovaPoshta\Models\Counterparty;
12
use SergeyNezbritskiy\NovaPoshta\Models\InternetDocument;
13
14
/**
15
 * Class Client
16
 *
17
 * Class-connector with NovaPoshta API
18
 *
19
 * @see      https://developers.novaposhta.ua/documentation
20
 */
21
readonly class Client
22
{
23
    public Address $address;
24
    public Counterparty $counterparty;
25
    public ContactPerson $contactPerson;
26
    public Common $common;
27
    public InternetDocument $internetDocument;
28
29
    /**
30
     * @param string $apiKey
31 2
     */
32
    public function __construct(string $apiKey)
33 2
    {
34
        $connection = new Connection($apiKey, new HttpClient());
35
        $this->address = new Address($connection);
36 2
        $this->counterparty = new Counterparty($connection);
37
        $this->contactPerson = new ContactPerson($connection);
38 2
        $this->common = new Common($connection);
39 1
        $this->internetDocument = new InternetDocument($connection);
40
    }
41
}
42