Conditions | 5 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
41 | public function __construct($value) |
||
42 | { |
||
43 | $min = 1; |
||
44 | $max = 2 ** 16; |
||
45 | |||
46 | if (null === $value) |
||
47 | { |
||
48 | return; |
||
49 | } |
||
50 | else if (! \is_int($value)) |
||
51 | { |
||
52 | throw new InvalidUriComponentException('URI component "port" must be an integer'); |
||
53 | } |
||
54 | else if (! ($value >= $min && $value <= $max)) |
||
55 | { |
||
56 | throw new InvalidUriComponentException('Invalid URI component "port"'); |
||
57 | } |
||
58 | |||
59 | $this->value = $value; |
||
60 | } |
||
72 |