Station   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 48
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A id() 0 4 1
A name() 0 4 1
1
<?php
2
3
namespace Sl;
4
5
use Sl\Contracts\Foundation\StationInterface;
6
7
class Station implements StationInterface
8
{
9
    /**
10
     * Station's id.
11
     *
12
     * @var int
13
     */
14
    private $id;
15
16
    /**
17
     * Station's name.
18
     *
19
     * @var string
20
     */
21
    private $name;
22
23
    /**
24
     * Create a new instance of Station.
25
     *
26
     * @param int    $id
27
     * @param string $name
28
     */
29 6
    public function __construct($id, $name = null)
30
    {
31 6
        $this->id = $id;
32 6
        $this->name = $name;
33 6
    }
34
35
    /**
36
     * Get station's id.
37
     *
38
     * @return int
39
     */
40 4
    public function id()
41
    {
42 4
        return $this->id;
43
    }
44
45
    /**
46
     * Get station's name.
47
     *
48
     * @return string|null
49
     */
50 3
    public function name()
51
    {
52 3
        return $this->name;
53
    }
54
}
55