Passed
Push — master ( 26e9e8...850720 )
by Andy
01:41
created

Time::setHour()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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