Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function __construct(Point $from, Point $to, $distance) |
||
11 | { |
||
12 | if (!(filter_var($distance, FILTER_VALIDATE_INT) || is_numeric($distance)) && ($distance > 0)) { |
||
13 | throw new ConnectionException('Distance must be positive number'); |
||
14 | } |
||
15 | |||
16 | $this->from = $from; |
||
17 | $this->to = $to; |
||
18 | $this->distance = $distance; |
||
19 | } |
||
20 | |||
26 |