DateRange   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 8
c 3
b 0
f 0
dl 0
loc 24
rs 10
ccs 9
cts 9
cp 1
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isEmpty() 0 3 2
A getEndDate() 0 3 1
A __construct() 0 4 1
A getStartDate() 0 3 1
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