Certificate::getCert()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CCT\Kong\Model;
6
7
class Certificate
8
{
9
    /**
10
     * PEM-encoded public certificate of the SSL key pair.
11
     *
12
     * @var string
13
     */
14
    protected $id;
15
16
    /**
17
     * PEM-encoded private key of the SSL key pair.
18
     *
19
     * @var string
20
     */
21
    protected $cert;
22
23
    /**
24
     * One or more hostnames to associate with this certificate as an SNI. This is a sugar parameter that will,
25
     * under the hood, create an SNI object and associate it with this certificate for your convenience.
26
     *
27
     * SNI: Server name indication
28
     *
29
     * @var array
30
     */
31
    protected $snis = [];
32
33
    /**
34
     * PEM-encoded private key of the SSL key pair.
35
     *
36
     * @var string
37
     */
38
    protected $key;
39
40
    /**
41
     * Gets the date of creation of Certificate.
42
     *
43
     * @var \DateTime
44
     */
45
    protected $createdAt;
46
47 5
    public function getId(): ?string
48
    {
49 5
        return $this->id;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 3
    public function getCert(): ?string
56
    {
57 3
        return $this->cert;
58
    }
59
60
    /**
61
     * @param string $cert
62
     *
63
     * @return static
64
     */
65 3
    public function setCert(string $cert): self
66
    {
67 3
        $this->cert = $cert;
68
69 3
        return $this;
70
    }
71
72
    /**
73
     * @return string
74
     */
75 3
    public function getKey(): ?string
76
    {
77 3
        return $this->key;
78
    }
79
80
    /**
81
     * @param string $key
82
     *
83
     * @return static
84
     */
85 6
    public function setKey(string $key): self
86
    {
87 6
        $this->key = $key;
88
89 6
        return $this;
90
    }
91
92
    /**
93
     * @return array
94
     */
95 1
    public function getSNIs(): array
96
    {
97 1
        return $this->snis;
98
    }
99
100
    /**
101
     * @param array $snis
102
     *
103
     * @return static
104
     */
105 1
    public function setSNIs(array $snis): self
106
    {
107 1
        $this->snis = $snis;
108
109 1
        return $this;
110
    }
111
112
    /**
113
     * @return \DateTime|null
114
     */
115 1
    public function getCreatedAt(): ?\DateTime
116
    {
117 1
        return $this->createdAt;
118
    }
119
}
120