Passed
Push — master ( 3eedbe...821bb4 )
by Sergey
57s queued 21s
created

Client::__get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
ccs 0
cts 0
cp 0
crap 6
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