Passed
Push — master ( 8b04a3...17b456 )
by Carlos C
48s queued 11s
created

ReportUuidCommand::rfc()   A

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpCfdi\Finkok\Services\Utilities;
6
7
use DateTimeImmutable;
8
use LogicException;
9
10
class ReportUuidCommand
11
{
12
    /** @var string */
13
    private $rfc;
14
15
    /** @var string */
16
    private $type;
17
18
    /** @var DateTimeImmutable */
19
    private $since;
20
21
    /** @var DateTimeImmutable */
22
    private $until;
23
24 3
    public function __construct(string $rfc, string $type, DateTimeImmutable $since, DateTimeImmutable $until)
25
    {
26 3
        if ($since > $until) {
27 1
            throw new LogicException('Since date is greater than until date');
28
        }
29 2
        $this->rfc = $rfc;
30 2
        $this->type = $type;
31 2
        $this->since = $since;
32 2
        $this->until = $until;
33 2
    }
34
35 2
    public function rfc(): string
36
    {
37 2
        return $this->rfc;
38
    }
39
40 2
    public function type(): string
41
    {
42 2
        return $this->type;
43
    }
44
45 1
    public function since(): DateTimeImmutable
46
    {
47 1
        return $this->since;
48
    }
49
50 1
    public function until(): DateTimeImmutable
51
    {
52 1
        return $this->until;
53
    }
54
55 2
    public function sinceString(): string
56
    {
57 2
        return $this->since->format('Y-m-d\TH:i:s');
58
    }
59
60 2
    public function untilString(): string
61
    {
62 2
        return $this->until->format('Y-m-d\TH:i:s');
63
    }
64
}
65