private function processModules(DependencyInjectionContainer $dic, array $modules, array &$config) {
		/** @noinspection PhpInternalEntityUsedInspection */
		$dependencyGraph = new ModuleDependencyGraph();
		$dependencyGraph->addModules($modules);
		$modules = $dependencyGraph->getSortedModuleList();

		foreach ($modules as $module) {
			$this->loadModuleConfiguration($module, $config);
		}

		foreach ($modules as $module) {
			$module->configureDependencyInjection($dic, $config[$module->getModuleKey()], $config);
		}
	}