From bec0700d396fe5e8934cb12dd87c2c3a23d4ec3d Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 30 Apr 2021 13:27:33 +0200 Subject: [PATCH] Point model: better handling of exception --- src/Bundle/ChillMainBundle/Doctrine/Model/Point.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php index 67cf434c0..43c21ae59 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php @@ -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