Total Complexity | 8 |
Total Lines | 111 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
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 |
|
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 |
|
118 | } |
||
119 | } |
||
120 |