WorkoutId::__construct()   A
last analyzed

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
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace SportTrackerConnector\Endomondo;
6
7
use SportTrackerConnector\Core\Workout\WorkoutIdInterface;
8
9
class WorkoutId implements WorkoutIdInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $id;
15
16
    /**
17
     * @param string $id
18
     */
19
    public function __construct(string $id)
20
    {
21
        $this->id = $id;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function toString(): string
28
    {
29
        return $this->id;
30
    }
31
32
    /**
33
     * @param WorkoutIdInterface $other
34
     * @return bool
35
     */
36
    public function equals(WorkoutIdInterface $other): bool
37
    {
38
        return $this->toString() === $other->toString();
39
    }
40
}
41