Passed
Push — master ( 0b7dea...b9611f )
by Mariano
04:34
created

SecureOptions::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Mcustiel\Phiremock\Server\Cli\Options;
4
5
class SecureOptions
6
{
7
    /** @var CertificatePath */
8
    private $certificate;
9
    /** @var CertificateKeyPath */
10
    private $certificateKey;
11
    /** @var Passphrase */
12
    private $passphrase;
13
14
    public function __construct(CertificatePath $cert, CertificateKeyPath $certKey, ?Passphrase $pass)
15
    {
16
        $this->certificate = $cert;
17
        $this->passphrase = $pass;
18
        $this->certificateKey = $certKey;
19
    }
20
21
    public function getCertificate(): CertificatePath
22
    {
23
        return $this->certificate;
24
    }
25
26
    public function getCertificateKey(): CertificateKeyPath
27
    {
28
        return $this->certificateKey;
29
    }
30
31
    public function hasPassphrase(): bool
32
    {
33
        return $this->passphrase !== null;
34
    }
35
36
    public function getPassphrase(): Passphrase
37
    {
38
        return $this->passphrase;
39
    }
40
}
41