src/Smrtr/HaltoRouter.php
public function addHostname($hostname, $hostGroup)
    {
        if (!is_string($hostGroup)) {
            throw new HaltoRouterException("Invalid hostgroup name");
        }

        if (!is_string($hostname)) {
            throw new HaltoRouterException("Invalid hostname");
        }

        if (!array_key_exists($hostGroup, $this->httpHostGroups)) {
            $this->httpHostGroups[$hostGroup] = array();
        }

        if (!in_array($hostname, $this->httpHostGroups[$hostGroup])) {
            $this->httpHostGroups[$hostGroup][] = $hostname;
        }

        return $this;
    }
public function addHostname($hostname, $hostGroup)
    {
        if (!is_string($hostGroup)) {
            throw new HaltoRouterException("Invalid hostgroup name");
        }

        if (!is_string($hostname)) {
            throw new HaltoRouterException("Invalid hostname");
        }

        if (!array_key_exists($hostGroup, $this->httpHostGroups)) {
            $this->httpHostGroups[$hostGroup] = array();
        }

        if (!in_array($hostname, $this->httpHostGroups[$hostGroup])) {
            $this->httpHostGroups[$hostGroup][] = $hostname;
        }

        return $this;
    }
Add a hostname to a hostgroup (creates the hostgroup if it doesn't exist).

@param string $hostname
@param string $hostGroup

@return $this

@throws HaltoRouterException