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

SecureOptions   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCertificate() 0 3 1
A getCertificateKey() 0 3 1
A hasPassphrase() 0 3 1
A getPassphrase() 0 3 1
A __construct() 0 5 1
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