Time   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormatFromTimePrecision() 0 3 1
1
<?php
2
3
namespace Palmtree\Chrono;
4
5
use Palmtree\Chrono\Option\TimePeriods;
6
7
/**
8
 * @method self   add(int $value, string $period)
9
 * @method self   subtract(int $value, string $period)
10
 * @method self   setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0)
11
 * @method self   setHour(int $hour)
12
 * @method self   setMinute(int $minute)
13
 * @method self   setSecond(int $second)
14
 * @method self   setMicroseconds(int $microseconds)
15
 * @method self   fromNative(\DateTime $dateTime)
16
 * @method static null|self min(...$dates)
17
 * @method static null|self max(...$dates)
18
 */
19
class Time extends DateTime
20
{
21 6
    protected function getFormatFromTimePrecision(?string $precision): string
22
    {
23 6
        return TimePeriods::getDateFormat($precision ?? TimePeriods::SECOND);
24
    }
25
}
26