Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function __construct($from, $to, $distance) |
||
11 | { |
||
12 | if (self::isPoint($from) && self::isPoint($to)) { |
||
13 | $this->from = $from; |
||
14 | $this->to = $to; |
||
15 | } else { |
||
16 | throw new ConnectionException('Sent data are not points'); |
||
17 | } |
||
18 | |||
19 | $distance = intval($distance); |
||
20 | if ($distance > 0) { |
||
21 | $this->distance = $distance; |
||
22 | } else { |
||
23 | throw new ConnectionException('Distance is less than or equal to zero'); |
||
24 | } |
||
25 | } |
||
26 | |||
47 |