1
2
3
4
5
6
7
8
9
10
11
12
13
14
public function generateForecast($random) {
  $forecasts = [
    1 => 'partly-cloudy',
    2 => 'fine',
    3 => 'sunny'
  ];

  $response = 'rain'; // default
  if (isset($forecasts[$random])) {
    $response = $forecasts[$random];
  }

  return $response;
}