Passed
Pull Request — master (#11)
by Carlos C
01:36
created

AddCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 12
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpCfdi\Finkok\Services\Registration;
6
7
class AddCommand
8
{
9
    /** @var string */
10
    private $rfc;
11
12
    /** @var CustomerType */
13
    private $type;
14
15
    /** @var string */
16
    private $certificate;
17
18
    /** @var string */
19
    private $privateKey;
20
21
    /** @var string */
22
    private $passPhrase;
23
24 3
    public function __construct(
25
        string $rfc,
26
        ?CustomerType $type = null,
27
        string $certificate = '',
28
        string $privateKey = '',
29
        string $passPhrase = ''
30
    ) {
31 3
        $this->rfc = $rfc;
32 3
        $this->type = $type ?? CustomerType::ondemand();
33 3
        $this->certificate = $certificate;
34 3
        $this->privateKey = $privateKey;
35 3
        $this->passPhrase = $passPhrase;
36 3
    }
37
38 3
    public function rfc(): string
39
    {
40 3
        return $this->rfc;
41
    }
42
43 3
    public function type(): CustomerType
44
    {
45 3
        return $this->type;
46
    }
47
48 3
    public function certificate(): string
49
    {
50 3
        return $this->certificate;
51
    }
52
53 3
    public function privateKey(): string
54
    {
55 3
        return $this->privateKey;
56
    }
57
58 3
    public function passPhrase(): string
59
    {
60 3
        return $this->passPhrase;
61
    }
62
}
63