Completed
Pull Request — master (#18)
by John
05:06 queued 03:09
created

DateFormatterDayOfYear::format()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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