add type hinting in Point and PointException

This commit is contained in:
nobohan
2021-04-22 09:32:46 +02:00
parent 0b2f29f1e8
commit c089960707
2 changed files with 21 additions and 17 deletions

View File

@@ -10,18 +10,17 @@ use \Exception;
*/
class PointException extends Exception {
public static function badCoordinates($lon, $lat)
public static function badCoordinates($lon, $lat): self
{
return new self("les coordonnées fournies sont invalides dans le système de projection utilisé (longitude = $lon , latitude = $lat)");
}
public static function badJsonString($str)
public static function badJsonString($str): self
{
return new self("la chaine JSON n'est pas valide : $str");
}
public static function badGeoType()
public static function badGeoType(): self
{
return new self("le type de l'objet GeoJSON est invalide");
}