WeatherData
in package
uses
TraitCache
FinalYes
Table of Contents
Properties
- $cache : Cache
- $forecastData : array<string|int, mixed>
- $httpClient : Client|null
- $latitude : float
- $longitude : float
- $town : string
- $weatherData : OpenMeteo|null
Methods
- __construct() : mixed
- displayForecast() : string
- Capsulate into div flex
- getCacheInstance() : Cache
- getForecastDay() : Weather|null
- Get weather forecast for a specific date
- getWeatherInfo() : string
- getWeatherText() : string
- cntHoursByDate() : array<string|int, array<string|int, mixed>>
- getDataByHour() : array<string|int, mixed>
- Data of an given hour
- getForecast() : array<string|int, Weather>
- getForecastFirst() : string
- getForecastLast() : string
- getForecastLoop() : string
- getMinMaxTemperaturesByDate() : array<string|int, array<string|int, mixed>>
- getWeatherData() : object
Properties
$cache
private
Cache
$cache
$forecastData
private
array<string|int, mixed>
$forecastData
$httpClient
private
static Client|null
$httpClient
= null
$latitude
private
float
$latitude
$longitude
private
float
$longitude
$town
private
string
$town
$weatherData
private
static OpenMeteo|null
$weatherData
= null
Methods
__construct()
public
__construct() : mixed
displayForecast()
Capsulate into div flex
public
displayForecast() : string
Return values
stringgetCacheInstance()
public
getCacheInstance() : Cache
Return values
CachegetForecastDay()
Get weather forecast for a specific date
public
getForecastDay(float $latitude, float $longitude, DateTime $date) : Weather|null
Parameters
- $latitude : float
- $longitude : float
- $date : DateTime
Return values
Weather|nullgetWeatherInfo()
public
getWeatherInfo([string $jsData = '' ]) : string
Parameters
- $jsData : string = ''
Return values
stringgetWeatherText()
public
getWeatherText([string $iconKey = 'night-cloudy-gusts' ]) : string
Parameters
- $iconKey : string = 'night-cloudy-gusts'
Return values
stringcntHoursByDate()
private
cntHoursByDate() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>getDataByHour()
Data of an given hour
private
getDataByHour(string $hour) : array<string|int, mixed>
Parameters
- $hour : string
Return values
array<string|int, mixed>getForecast()
private
getForecast() : array<string|int, Weather>
Return values
array<string|int, Weather>getForecastFirst()
private
getForecastFirst() : string
Return values
stringgetForecastLast()
private
getForecastLast() : string
Return values
stringgetForecastLoop()
private
getForecastLoop() : string
Return values
stringgetMinMaxTemperaturesByDate()
private
getMinMaxTemperaturesByDate() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>getWeatherData()
private
getWeatherData() : object