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