private function loadModule(
		$moduleClass,
		array &$modules,
		array $moduleList,
		DependencyInjectionContainer $dic) {
		/**
		 * @var Module $module
		 */
		$module = $dic->make($moduleClass);

		if (!$module instanceof Module) {
			throw new ConfigurationException(get_class($module) .
				' was configured as a module, but doesn\'t implement ' . Module::class);
		}

		if (!\in_array($module, $modules)) {
			$dic->share($module);

			$this->loadRequiredModules($module, $modules, $moduleList, $dic);

			$modules[] = $module;
		}
	}