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