DateFormatterDayOfYearFixedLength   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 4 1
1
<?php
2
3
namespace Graze\CiffRenderer\DateFormatter;
4
5
use Graze\CiffRenderer\DateFormatter\DateFormatterDayOfYear;
6
use Graze\CiffRenderer\DateFormatter\DateFormatterInterface;
7
use \DateTimeInterface;
8
9
class DateFormatterDayOfYearFixedLength extends DateFormatterDayOfYear implements DateFormatterInterface
10
{
11
    /**
12
     * @param DateTimeInterface $date
13
     * @param string $format
14
     * @return string
15
     */
16 2
    public function format(DateTimeInterface $date, $format)
17
    {
18 2
        $dayOfYear = parent::format($date, $format);
19 2
        return str_pad($dayOfYear, 3, '0', STR_PAD_LEFT);
20
    }
21
}
22