Completed
Push — master ( c7900c...5b8c32 )
by Dragos
03:38 queued 01:57
created

WorkoutSummary::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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