Add functions for validating longitudes and latitutdes
This commit is contained in:
20
exceptions/MDCoordinateOutOfRange.php
Normal file
20
exceptions/MDCoordinateOutOfRange.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for coordinates (longitude, latitude) that are out
|
||||
* of range (-90 - 90 for latitudes, -180 to 180 for longitudes).
|
||||
*/
|
||||
final class MDCoordinateOutOfRange extends MDExpectedException {
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user