DateTimeConverter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toWireFormattedString() 0 4 1
1
<?php
2
namespace PSB\Core;
3
4
/**
5
 * The assumption made by this class is that all times are provided by a Clock which deals only in UTC
6
 */
7
class DateTimeConverter
8
{
9
    private $format = 'Y-m-d\TH:i:s\Z';
10
11
    /**
12
     * @param \DateTime $date
13
     *
14
     * @return string
15
     */
16 1
    public function toWireFormattedString(\DateTime $date)
17
    {
18 1
        return $date->format($this->format);
19
    }
20
}
21