public function mergeWith($config)
    {
        if ($this->isArray($config) || $this->isArrayObject($config)) {
            $config = Config::getInstance()->php(StdObjectWrapper::toArray($config));
        }

        foreach ($config as $key => $value) {
            if ($this->data->keyExists($key)) {
                if (is_numeric($key)) {
                    $this->data[$key] = $value;
                    continue;
                } elseif ($value instanceof ConfigObject && $this->data[$key] instanceof ConfigObject) {
                    $this->data[$key]->mergeWith($value);
                    continue;
                }
            }
            $this->data[$key] = $value instanceof ConfigObject ? new ConfigObject($value->toArray()) : $value;
        }

        return $this;
    }