Skip to content

Commit

Permalink
Minor code fixes; readme typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhansen committed Jul 6, 2024
1 parent 8963f29 commit 7fa9002
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHP Library for the Nationanl Weather Service REST API
# PHP Library for the National Weather Service REST API

Provides an intuitive interface to use the NWS REST API in any PHP application.

Expand Down
5 changes: 2 additions & 3 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Api
{
protected Psr16Adapter|null $cache = null;
private Psr16Adapter|null $cache = null;
private string $base_url = "https://api.weather.gov";
private string $user_agent;
private HttpClient $client;
Expand Down Expand Up @@ -43,10 +43,9 @@ public function getUserAgent(): string
return $this->user_agent;
}

public function setUserAgent(string $domain, string $email): self
private function setUserAgent(string $domain, string $email): void
{
$this->user_agent = "({$domain}, {$email})";
return $this;
}

public function getCacheLifetime(): int
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function gridY(): int
return $this->properties_gridY();
}

public function latestObservations($observation_station_index = 0): LatestObservations
public function latestObservations(int $observation_station_index = 0): LatestObservations
{
return $this->observationStations()->station($observation_station_index)->latestObservations();
}
Expand Down

0 comments on commit 7fa9002

Please sign in to comment.