From e90ea3168367c8f3e2ba0e3f73f51a8024da808d Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 22 Apr 2021 09:45:12 +0200 Subject: [PATCH] add type hinting in Point and PointException --- src/Bundle/ChillMainBundle/Doctrine/Model/Point.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php index 3ef5fe768..d987637ce 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php @@ -13,7 +13,7 @@ class Point implements JsonSerializable { private float $lon; public static string $SRID = '4326'; - private function __construct($lon, $lat) + private function __construct(float $lon, float $lat) { $this->lat = $lat; $this->lon = $lon; @@ -52,7 +52,7 @@ class Point implements JsonSerializable { * @param type $geojson * @return Point */ - public static function fromGeoJson($geojson): Point + public static function fromGeoJson(string $geojson): Point { $a = json_decode($geojson); //check if the geojson string is correct @@ -70,7 +70,7 @@ class Point implements JsonSerializable { } - public static function fromLonLat($lon, $lat): Point + public static function fromLonLat(float $lon, float $lat): Point { if (($lon > -180 && $lon < 180) && ($lat > -90 && $lat < 90)) { @@ -80,7 +80,7 @@ class Point implements JsonSerializable { } } - public static function fromArrayGeoJson($array): Point + public static function fromArrayGeoJson(array $array): Point { if ($array['type'] == 'Point' && isset($array['coordinates']))