| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | 22 | public function __construct(Coordinate $source, Coordinate $destination, float $distance) |
|
| 12 | { |
||
| 13 | 22 | if ($distance < 0) { |
|
| 14 | 2 | throw new \InvalidArgumentException("Invalid distance: $distance"); |
|
| 15 | } |
||
| 16 | |||
| 17 | 20 | $this->source = $source; |
|
| 18 | 20 | $this->destination = $destination; |
|
| 19 | 20 | $this->distance = $distance; |
|
| 20 | 20 | } |
|
| 37 |