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

WorkoutSummary::sport()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
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