Passed
Pull Request — master (#28)
by Manuel
02:43
created

RequestHeader::getCustomerId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Ticketpark\SaferpayJson\Request\Container;
4
5
use JMS\Serializer\Annotation\SerializedName;
6
7
final class RequestHeader
8
{
9
    /**
10
     * @var string
11
     * @SerializedName("SpecVersion")
12
     */
13
    private $specVersion = '1.17';
14
15
    /**
16
     * @var string
17
     * @SerializedName("CustomerId")
18
     */
19
    private $customerId;
20
21
    /**
22
     * @var string|null
23
     * @SerializedName("RequestId")
24
     */
25
    private $requestId;
26
27
    /**
28
     * @var int
29
     * @SerializedName("RetryIndicator")
30
     */
31
    private $retryIndicator = 0;
32
33
    /**
34
     * @var ClientInfo|null
35
     * @SerializedName("ClientInfo")
36
     */
37
    private $clientInfo;
38
39
    public function __construct(string $customerId, string $requestId = null, int $retryIndicator = 0)
40
    {
41
        $this->customerId = $customerId;
42
        $this->requestId = $requestId;
43
        $this->retryIndicator = $retryIndicator;
44
45
        if (null === $requestId && 0 === $retryIndicator) {
46
            $this->requestId = uniqid();
47
        }
48
    }
49
50
    public function getSpecVersion(): string
51
    {
52
        return $this->specVersion;
53
    }
54
55
    public function getCustomerId(): string
56
    {
57
        return $this->customerId;
58
    }
59
60
    public function getRequestId(): ?string
61
    {
62
        return $this->requestId;
63
    }
64
65
    public function getRetryIndicator(): int
66
    {
67
        return $this->retryIndicator;
68
    }
69
70
    public function getClientInfo(): ?ClientInfo
71
    {
72
        return $this->clientInfo;
73
    }
74
75
    public function setClientInfo(?ClientInfo $clientInfo): self
76
    {
77
        $this->clientInfo = $clientInfo;
78
79
        return $this;
80
    }
81
}
82