Passed
Pull Request — master (#28)
by Manuel
09:19
created

RequestConfig::getApiKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Ticketpark\SaferpayJson\Request;
4
5
use GuzzleHttp\Client;
6
7
final class RequestConfig
8
{
9
    /**
10
     * @var string
11
     */
12
    private $apiKey;
13
14
    /**
15
     * @var string
16
     */
17
    private $apiSecret;
18
19
    /**
20
     * @var string
21
     */
22
    private $customerId;
23
24
    /**
25
     * @var bool
26
     */
27
    private $test;
28
29
    /**
30
     * @var \GuzzleHttp\Client
31
     */
32
    private $client;
33
34
    public function __construct(string $apiKey, string $apiSecret, string $customerId, bool $test = false)
35
    {
36
        $this->apiKey = $apiKey;
37
        $this->apiSecret = $apiSecret;
38
        $this->customerId = $customerId;
39
        $this->test = $test;
40
    }
41
42
    public function getApiKey(): string
43
    {
44
        return $this->apiKey;
45
    }
46
47
    public function getApiSecret(): string
48
    {
49
        return $this->apiSecret;
50
    }
51
52
    public function getCustomerId(): string
53
    {
54
        return $this->customerId;
55
    }
56
57
    public function isTest(): bool
58
    {
59
        return $this->test;
60
    }
61
62
    public function setClient(Client $client): self
63
    {
64
        $this->client = $client;
65
66
        return $this;
67
    }
68
69
    public function getClient(): Client
70
    {
71
        if (null === $this->client) {
72
            return new Client();
73
        }
74
75
        return $this->client;
76
    }
77
}
78