DatePeriods   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIntervalCodes() 0 6 1
A getDateFormats() 0 6 1
1
<?php
2
3
namespace Palmtree\Chrono\Option;
4
5
abstract class DatePeriods extends AbstractPeriods
6
{
7
    public const YEAR  = 'year';
8
    public const MONTH = 'month';
9
    public const DAY   = 'day';
10
11 6
    protected static function getIntervalCodes(): array
12
    {
13
        return [
14 6
            self::YEAR  => 'Y',
15 6
            self::MONTH => 'M',
16 6
            self::DAY   => 'D',
17
        ];
18
    }
19
20 11
    protected static function getDateFormats(): array
21
    {
22
        return [
23 11
            self::YEAR  => 'Y',
24 11
            self::MONTH => 'Ym',
25 11
            self::DAY   => 'Ymd',
26
        ];
27
    }
28
}
29