diff --git a/src/Observation/Pressure.php b/src/Observation/Pressure.php index 2e2026b..103a071 100644 --- a/src/Observation/Pressure.php +++ b/src/Observation/Pressure.php @@ -19,6 +19,26 @@ final class Pressure { */ protected ?int $meanSeaLevel = NULL; + /** + * The pressure, in hectopascals. + */ + protected ?float $pressure = NULL; + + /** + * Gets the pressure in hectopascals. + */ + public function getPressure(): ?float { + return $this->pressure; + } + + /** + * Sets the pressure in hectopascals. + */ + public function setPressure(?float $pressure): Pressure { + $this->pressure = $pressure; + return $this; + } + /** * Gets the PressureQnh. */ diff --git a/src/Observation/Serializer/ObservationListNormalizer.php b/src/Observation/Serializer/ObservationListNormalizer.php index f229aba..86c2683 100644 --- a/src/Observation/Serializer/ObservationListNormalizer.php +++ b/src/Observation/Serializer/ObservationListNormalizer.php @@ -25,7 +25,9 @@ public function denormalize($data, $type, $format = NULL, array $context = []) { } $observationList = new ObservationList(); - $observationList->setRefreshMessage($data['observations']['header'][0]['refresh_message']); + if (\array_key_exists('header', $data['observations'])) { + $observationList->setRefreshMessage($data['observations']['header'][0]['refresh_message']); + } \array_map(function ($observationData) use ($observationList): void { $observationList->addObservation($this->serializer->denormalize($observationData, Observation::class)); diff --git a/src/Observation/Station.php b/src/Observation/Station.php index 31fd11a..e475a51 100644 --- a/src/Observation/Station.php +++ b/src/Observation/Station.php @@ -29,6 +29,16 @@ final class Station { */ protected ?float $longitude = NULL; + /** + * The station ID. + */ + protected ?int $wmoId = NULL; + + /** + * The station ID. + */ + protected string|int|null $bomId = NULL; + /** * Gets the Name. */ @@ -89,4 +99,34 @@ public function setId(int $id): self { return $this; } + /** + * Gets the BOM ID. + */ + public function getBomId(): ?int { + return $this->bomId; + } + + /** + * Sets the BOM ID. + */ + public function setBomId(string|int $id): self { + $this->bomId = $id; + return $this; + } + + /** + * Gets the WMO ID. + */ + public function getWmoId(): ?int { + return $this->wmoId; + } + + /** + * Sets the Wmo ID. + */ + public function setWmoId(int $id): self { + $this->wmoId = $id; + return $this; + } + } diff --git a/src/Observation/Temperature.php b/src/Observation/Temperature.php index 41c63d9..9d847a9 100644 --- a/src/Observation/Temperature.php +++ b/src/Observation/Temperature.php @@ -14,6 +14,16 @@ final class Temperature { */ protected ?float $airTemp = NULL; + /** + * The maximum air temperature, in Celsius. + */ + protected ?float $maximumAirTemp = NULL; + + /** + * The minimum air temperature, in Celsius. + */ + protected ?float $minimumAirTemp = NULL; + /** * The apparent temperature, in Celsius. */ @@ -49,6 +59,36 @@ public function setAirTemp(float $airTemp): Temperature { return $this; } + /** + * Gets the maximum AirTemp. + */ + public function getMaximumAirTemp(): ?float { + return $this->maximumAirTemp; + } + + /** + * Sets the maximum AirTemp. + */ + public function setMaximumAirTemp(float $airTemp): Temperature { + $this->maximumAirTemp = $airTemp; + return $this; + } + + /** + * Gets the minimum AirTemp. + */ + public function getMinimumAirTemp(): ?float { + return $this->minimumAirTemp; + } + + /** + * Sets the minimum AirTemp. + */ + public function setMinimumAirTemp(float $airTemp): Temperature { + $this->minimumAirTemp = $airTemp; + return $this; + } + /** * Gets the ApparentTemp. */ diff --git a/src/Observation/Wind.php b/src/Observation/Wind.php index 003de06..a3947ac 100644 --- a/src/Observation/Wind.php +++ b/src/Observation/Wind.php @@ -34,6 +34,71 @@ final class Wind { */ protected ?int $gustKnots = NULL; + /** + * The wind gusts, in kilometres per Hour. + */ + protected ?int $maximumGustKmh = NULL; + + /** + * The wind gusts, in knots. + */ + protected ?int $maximumGustSpeed = NULL; + + /** + * The wind gusts, in knots. + */ + protected ?string $maximumGustDirection = NULL; + + /** + * The wind direction in degree. + */ + protected ?int $windDirectionDegree = NULL; + + /** + * Gets the maximum gust speed in kilometers per hour. + */ + public function getMaximumGustKmh(): ?int { + return $this->maximumGustKmh; + } + + /** + * Set the maximum gust speed in kilometers per hour. + */ + public function setMaximumGustKmh(?int $maximumGustKmh): Wind { + $this->maximumGustKmh = $maximumGustKmh; + return $this; + } + + /** + * Gets the maximum gust speed in knots. + */ + public function getMaximumGustSpeed(): ?int { + return $this->maximumGustSpeed; + } + + /** + * Sets the maximum gust speed in knots. + */ + public function setMaximumGustSpeed(?int $maximumGustSpeed): Wind { + $this->maximumGustSpeed = $maximumGustSpeed; + return $this; + } + + /** + * Sets the maximum gust direction. + */ + public function getMaximumGustDirection(): ?string { + return $this->maximumGustDirection; + } + + /** + * Gets the maximum gust direction. + */ + public function setMaximumGustDirection(string $maximumGustDirection): Wind { + $this->maximumGustDirection = $maximumGustDirection; + return $this; + } + /** * Gets the Direction. */ @@ -109,4 +174,19 @@ public function setGustKnots(int $gustKnots): Wind { return $this; } + /** + * Gets the wind direction in degree. + */ + public function getWindDirectionDegree(): ?int { + return $this->windDirectionDegree; + } + + /** + * Sets the wind direction in degree. + */ + public function setWindDirectionDegree(int $gustKnots): Wind { + $this->windDirectionDegree = $gustKnots; + return $this; + } + }