DateRange::isEmpty()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 2
b 0
f 0
ccs 2
cts 2
cp 1
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shlinkio\Shlink\Common\Util;
6
7
use Cake\Chronos\Chronos;
8
9
final class DateRange
10
{
11
    private ?Chronos $startDate;
12
    private ?Chronos $endDate;
13
14 6
    public function __construct(?Chronos $startDate = null, ?Chronos $endDate = null)
15
    {
16 6
        $this->startDate = $startDate;
17 6
        $this->endDate = $endDate;
18
    }
19
20 2
    public function getStartDate(): ?Chronos
21
    {
22 2
        return $this->startDate;
23
    }
24
25 2
    public function getEndDate(): ?Chronos
26
    {
27 2
        return $this->endDate;
28
    }
29
30 6
    public function isEmpty(): bool
31
    {
32 6
        return $this->startDate === null && $this->endDate === null;
33
    }
34
}
35