| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function getDistanceBetween(PointInterface $pointA, PointInterface $pointB): float |
||
| 13 | { |
||
| 14 | if (! $pointA instanceof Point || ! $pointB instanceof Point) { |
||
| 15 | throw new \InvalidArgumentException( |
||
| 16 | "GPS algorithm can only calculate distance from GPS locations" |
||
| 17 | ); |
||
| 18 | } |
||
| 19 | |||
| 20 | return Math::haversine($pointA->getCoordinates(), $pointB->getCoordinates()); |
||
| 21 | } |
||
| 39 |