Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
33 | 55 | public function __construct($value) |
|
34 | { |
||
35 | 55 | if ($value === null) { |
|
36 | 2 | return; |
|
37 | } |
||
38 | |||
39 | 55 | if (!is_int($value)) { |
|
40 | 8 | throw new InvalidArgumentException('URI component "port" must be an integer'); |
|
41 | } |
||
42 | |||
43 | 47 | if (!($value >= self::MIN_VALUE && $value <= self::MAX_VALUE)) { |
|
44 | 3 | throw new InvalidArgumentException('Invalid URI component "port"'); |
|
45 | } |
||
46 | |||
47 | 47 | $this->value = $value; |
|
48 | } |
||
60 |