Completed
Pull Request — master (#19)
by John
05:56 queued 03:42
created

DateFormatterDayOfYear   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 5 1
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