Completed
Push — master ( 5b8c32...9783e3 )
by Dragos
02:59
created

WorkoutSummary   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 59
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A workoutId() 0 4 1
A sport() 0 4 1
A startDateTime() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace SportTrackerConnector\Core\Workout;
6
7
final class WorkoutSummary
8
{
9
    /**
10
     * The ID of the workout.
11
     *
12
     * @var WorkoutIdInterface
13
     */
14
    private $workoutId;
15
16
    /**
17
     * The sport. One of the constants from SportMapperInterface.
18
     *
19
     * @var string
20
     */
21
    private $sport;
22
23
    /**
24
     * The start date time of the workout.
25
     *
26
     * @var \DateTimeImmutable
27
     */
28
    private $startDateTime;
29
30
    /**
31
     * @param WorkoutIdInterface $workoutId
32
     * @param string $sport
33
     * @param \DateTimeImmutable $startDateTime
34
     */
35
    public function __construct(WorkoutIdInterface $workoutId, string $sport, \DateTimeImmutable $startDateTime)
36
    {
37
        $this->workoutId = $workoutId;
38
        $this->sport = $sport;
39
        $this->startDateTime = $startDateTime;
40
    }
41
42
    /**
43
     * @return WorkoutIdInterface
44
     */
45
    public function workoutId(): WorkoutIdInterface
46
    {
47
        return $this->workoutId;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function sport(): string
54
    {
55
        return $this->sport;
56
    }
57
58
    /**
59
     * @return \DateTimeImmutable
60
     */
61
    public function startDateTime(): \DateTimeImmutable
62
    {
63
        return $this->startDateTime;
64
    }
65
}
66