protected function processImports(array $config, $importDir)
    {
        if (isset($config["inherit"])) {
            $filePath = $this->findImportedConfigFile($config["inherit"], $importDir);
            $inheritedConfig = $this->loadConfig($filePath);
            // check for recursive imports or inheritance
            $inheritedConfig = $this->processImports($inheritedConfig, $importDir);
            $config = array_replace_recursive($inheritedConfig, $config);
        }
        if (isset($config["imports"]) && is_array($config["imports"])) {
            foreach ($config["imports"] as $file) {
                $filePath = $this->findImportedConfigFile($file, $importDir);
                $importConfig = $this->loadConfig($filePath);
                // check for recursive imports or inheritance
                $importConfig = $this->processImports($importConfig, $importDir);
                $config = array_replace_recursive($config, $importConfig);
            }
        }

        return $config;
    }