mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Point model: better handling of exception
This commit is contained in:
parent
05d3d7f5c7
commit
bec0700d39
@ -60,14 +60,14 @@ class Point implements JsonSerializable {
|
||||
throw PointException::badJsonString($geojson);
|
||||
}
|
||||
|
||||
if ($a->type != "Point"){
|
||||
if ($a->type != 'Point'){
|
||||
throw PointException::badGeoType();
|
||||
} else {
|
||||
$lat = $a->coordinates[1];
|
||||
$lon = $a->coordinates[0];
|
||||
return Point::fromLonLat($lon, $lat);
|
||||
}
|
||||
|
||||
$lat = $a->coordinates[1];
|
||||
$lon = $a->coordinates[0];
|
||||
|
||||
return Point::fromLonLat($lon, $lat);
|
||||
}
|
||||
|
||||
public static function fromLonLat(float $lon, float $lat): Point
|
||||
|
Loading…
x
Reference in New Issue
Block a user