Completed
Pull Request — master (#1)
by steven
04:41 queued 02:25
created

Year   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
1
<?php
2
3
namespace VSV\GVQ_API\Question;
4
5
class Year
6
{
7
    /**
8
     * @var int
9
     */
10
    private $value;
11
12
    /**
13
     * @param int $value
14
     */
15
    public function __construct(int $value)
16
    {
17
        if ($value < 2018 || $value > 2100) {
18
            throw new \InvalidArgumentException(
19
                'Invalid value '.$value.' for year, value has to be above 2018 and below 2100'
20
            );
21
        }
22
23
        $this->value = $value;
24
    }
25
}
26