diff --git a/src/Dtos/DegreesLocation.php b/src/Dtos/DegreesLocation.php index 0466eed..9378477 100644 --- a/src/Dtos/DegreesLocation.php +++ b/src/Dtos/DegreesLocation.php @@ -9,7 +9,12 @@ final class DegreesLocation public function __construct(float $latitude, float $longitude) { - $this->latitude = new DegreesCoordinate($latitude, 'N', 'S'); - $this->longitude = new DegreesCoordinate($longitude, 'E', 'W'); + $this->latitude = new DegreesCoordinate($latitude, 'N', 'S'); + $this->longitude = new DegreesCoordinate($longitude, 'E', 'W'); + } + + public function __toString(): string + { + return $this->latitude . ' ' . $this->longitude; } } diff --git a/src/Dtos/Location.php b/src/Dtos/Location.php index 6287f5d..627c500 100644 --- a/src/Dtos/Location.php +++ b/src/Dtos/Location.php @@ -31,4 +31,9 @@ public function toDegrees(): DegreesLocation { return new DegreesLocation($this->latitude, $this->longitude); } + + public function __toString(): string + { + return $this->latitude . ", " . $this->longitude; + } }