Skip to content

Instantly share code, notes, and snippets.

@mcsee

mcsee/validated.php

Last active Nov 17, 2020
Embed
What would you like to do?
<?
final class GeographicCoordinate {
function __construct($latitude, $langitude) {
if (!$this->isValidLatitude($latitude)) {
throw new InvalidLatitudeException($latitude);
//...
$this->longitude = $longitude;
$this->latitude = $latitude;
}
}
$coordinate = new GeographicCoordinate(1000, 2000);
//trows 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
You can’t perform that action at this time.