Completed
Push — master ( 88150f...580efa )
by Laurent
04:58 queued 02:17
created

StudentId::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
/**
7
 * User id of the student.
8
 *
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class StudentId
12
{
13
14
    /**
15
     * @var int
16
     */
17
    private $id;
18
19
    /**
20
     * @param int $id
21
     */
22
    public function __construct($id)
23
    {
24
        if ((int) $id <= 0) {
25
            throw new InvalidArgumentException('Invalid Student ID');
26
        }
27
28
        $this->id = (int) $id;
29
    }
30
31
    /**
32
     * @return int
33
     */
34
    public function getId()
35
    {
36
        return $this->id;
37
    }
38
39
}