code: public function addHostnames(array $hostnames, $hostGroup)
      {
          if (!is_string($hostGroup)) {
              throw new HaltoRouterException("Invalid hostgroup name");
          }
  
          if (!is_array($hostnames)) {
              throw new HaltoRouterException("Array of hostnames expected");
          }
  
          if (!array_key_exists($hostGroup, $this->httpHostGroups)) {
              $this->httpHostGroups[$hostGroup] = array();
          }
  
          foreach ($hostnames as $hostname) {
              if (!is_string($hostname)) {
                  continue;
              }
              if (!in_array($hostname, $this->httpHostGroups[$hostGroup])) {
                  $this->httpHostGroups[$hostGroup][] = $hostname;
              }
          }
  
          return $this;
      }
docs: Add an array of hostnames to a hostgroup (creates the hostgroup if it doesn't exist).
  
  @param array $hostnames
  @param string $hostGroup
  
  @return $this
  
  @throws HaltoRouterException