GetDisplayWeatherUseCase
in package
Read onlyYes
Provides weather data formatted for display page
Table of Contents
Properties
- $cacheTtlSeconds : int
- $logger : LoggerInterface
- $weatherRepository : WeatherRepositoryInterface
- $weatherService : WeatherServiceInterface
Methods
- __construct() : mixed
- execute() : array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|null
- formatDisplay() : array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|null
- isCacheFresh() : bool
Properties
$cacheTtlSeconds
private
int
$cacheTtlSeconds
$logger
private
LoggerInterface
$logger
$weatherRepository
private
WeatherRepositoryInterface
$weatherRepository
$weatherService
private
WeatherServiceInterface
$weatherService
Methods
__construct()
public
__construct(WeatherServiceInterface $weatherService, WeatherRepositoryInterface $weatherRepository, LoggerInterface $logger, int $cacheTtlSeconds) : mixed
Parameters
- $weatherService : WeatherServiceInterface
- $weatherRepository : WeatherRepositoryInterface
- $logger : LoggerInterface
- $cacheTtlSeconds : int
execute()
public
execute() : array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|null
Return values
array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|nullformatDisplay()
private
formatDisplay(array<string, mixed> $weatherData) : array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|null
Parameters
- $weatherData : array<string, mixed>
Return values
array{temperature: string, pressure: string, airlyAdvice: string, airlyDescription: string, airlyColour: string}|nullisCacheFresh()
private
isCacheFresh(DateTimeImmutable|null $fetchedOn) : bool
Parameters
- $fetchedOn : DateTimeImmutable|null