Passed
Push — master ( d265e3...e69457 )
by Christophe
05:00
created

DateOutput   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A draw() 0 5 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\Output\Javascript;
4
5
use CMEN\GoogleChartsBundle\Output\DateOutputInterface;
6
7
/**
8
 * @author Christophe Meneses
9
 */
10
class DateOutput implements DateOutputInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 2
    public function draw(\DateTimeInterface $date)
16
    {
17 2
        return 'new Date('.$date->format('Y').', '.($date->format('n') - 1).', '.$date->format('j').', '.
18 2
            $date->format('H').', '.$date->format('i').', '.$date->format('s').')';
19
    }
20
}
21