WorkoutId   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toString() 0 4 1
A equals() 0 4 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