Completed
Push — master ( 0a9eac...f48757 )
by Dragos
02:35
created

AbstractTracker::getTimeZoneOffset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace SportTrackerConnector\Core\Tracker;
6
7
use SportTrackerConnector\Core\Workout\SportMapperInterface;
8
9
/**
10
 * Abstract tracker.
11
 */
12
abstract class AbstractTracker implements TrackerInterface
13
{
14
    /**
15
     * The sport mapper.
16
     *
17
     * @var SportMapperInterface
18
     */
19
    protected $sportMapper;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getSportMapper() : SportMapperInterface
25
    {
26
        if ($this->sportMapper === null) {
27
            $this->sportMapper = $this->constructSportMapper();
28
        }
29
30
        return $this->sportMapper;
31
    }
32
33
    /**
34
     * Construct the sport mapper.
35
     *
36
     * @return SportMapperInterface
37
     */
38
    abstract protected function constructSportMapper() : SportMapperInterface;
39
}
40