Completed
Pull Request — master (#18)
by John
03:38
created

FormatterDayOfYear   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
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\Field\Parser\DateParser\DateFormatter;
4
5
use Graze\CiffRenderer\Field\Parser\DateParser\DateFormatter\DateFormatterInterface;
6
use \DateTimeInterface;
7
8
class FormatterDayOfYear implements DateFormatterInterface
9
{
10
    /**
11
     * @param DateTimeInterface $date
12
     * @param string $format
13
     *
14
     * @return string
15
     */
16
    public function format(DateTimeInterface $date, $format)
17
    {
18
        // Clarisoft starts from 1, PHP from 0
19
        return (string) ($date->format('z') + 1);
20
    }
21
}
22