-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated location and added related entities
- Loading branch information
1 parent
c279e6e
commit 9ffd0ba
Showing
10 changed files
with
214 additions
and
55 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace ProgrammatorDev\OpenWeatherMap\Entity\Geocoding; | ||
|
||
use ProgrammatorDev\OpenWeatherMap\Entity\Coordinate; | ||
|
||
class ZipLocation | ||
{ | ||
private string $zipCode; | ||
|
||
private string $name; | ||
|
||
private string $countryCode; | ||
|
||
private Coordinate $coordinate; | ||
|
||
public function __construct(array $data) | ||
{ | ||
$this->zipCode = $data['zip']; | ||
$this->name = $data['name']; | ||
$this->countryCode = $data['country']; | ||
|
||
$this->coordinate = new Coordinate([ | ||
'lat' => $data['lat'], | ||
'lon' => $data['lon'] | ||
]); | ||
} | ||
|
||
public function getZipCode(): string | ||
{ | ||
return $this->zipCode; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function getCountryCode(): string | ||
{ | ||
return $this->countryCode; | ||
} | ||
|
||
public function getCoordinate(): Coordinate | ||
{ | ||
return $this->coordinate; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.