Last active
August 20, 2023 20:51
-
-
Save mcsee/4753e242da21027d2a8e7243de877250 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
final class GeographicCoordinate { | |
function __construct($latitudeInDegrees, $longitudeInDegrees) { | |
if (!$this->isValidLatitude($latitudeInDegrees)) { | |
throw new InvalidLatitudeException($latitudeInDegrees); | |
// ... | |
$this->longitude = $longitudeInDegrees; | |
$this->latitude = $latitudeInDegrees; | |
} | |
} | |
} | |
$coordinate = new GeographicCoordinate(1000, 2000); | |
// throws an error since these values don't exist on Earth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment