code: private function createAlertsForType($type, array $messages)
      {
          $alerts = array();
  
          foreach ($messages as $msg) {
              $alerts[] = new Alert($type, $msg);
          }
  
          return $alerts;
      }
docs: Creates alert objects for a type
  
  @param string $type
  @param array $messages
  @return Alert[]