Completed
Push — master ( 29e10f...fe40b0 )
by Peter
03:37 queued 21s
created

Converter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDateTime() 0 4 1
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2016, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Bundle\DateBundle\TimeZone;
11
12
use GpsLab\Bundle\DateBundle\Converter as DateConverter;
13
use GpsLab\Bundle\DateBundle\TimeZone\Keeper\KeeperInterface;
14
15
class Converter extends DateConverter
16
{
17
    /**
18
     * @var KeeperInterface
19
     */
20
    private $keeper;
21
22
    /**
23
     * @param KeeperInterface $keeper
24
     */
25 4
    public function __construct(KeeperInterface $keeper)
26
    {
27 4
        $this->keeper = $keeper;
28 4
    }
29
30
    /**
31
     * @param mixed $date
32
     *
33
     * @return \DateTime
34
     */
35 4
    public function getDateTime($date)
36
    {
37 4
        return parent::getDateTime($date)->setTimezone($this->keeper->getUserTimeZone());
38
    }
39
}
40