function __construct(WeatherData $weatherData) { $this->weatherData = $weatherData; $weatherData->registerObserver($this); }