Completed
Push — master ( 6c3b78...8b46fe )
by John
04:40
created

DayOfYearFormatter::format()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Graze\CiffRenderer\Field\Parser\DateParser\DateFormatter;
4
5
use Graze\CiffRenderer\Field\Parser\DateParser\DateFormatter\DateFormatterInterface;
6
use \DateTimeInterface;
7
8
class DayOfYearFormatter implements DateFormatterInterface
9
{
10
    /**
11
     * @param DateTimeInterface $date
12
     * @param string $format
13
     *
14
     * @return string
15
     */
16 2
    public function format(DateTimeInterface $date, $format)
17
    {
18
        // Clarisoft starts from 1, PHP from 0
19 2
        return (string) ($date->format('z') + 1);
20
    }
21
}
22