Validate module metadata extend section.
Only Unified Namespace shop classes are free to patch.

@param \OxidEsales\Eshop\Core\Module\Module $module

@throws ModuleValidationException
196949
protected function validateMetadataExtendSection(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $validator = $this->getModuleMetadataValidator();
        $validator->checkModuleExtensionsForIncorrectNamespaceClasses($module);
    }
445183
protected function _addExtensions(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $modules = $this->_removeNotUsedExtensions($this->getModulesWithExtendedClass(), $module);

        if ($module->hasExtendClass()) {
            $this->validateMetadataExtendSection($module);
            $addModules = $module->getExtensions();
            $modules = $this->_mergeModuleArrays($modules, $addModules);
        }

        $modules = $this->buildModuleChains($modules);

        $this->_saveToConfig('aModules', $modules);
    }
224087
def register_module(self, module, namespace=None):
        
        namespace = namespace if namespace is not None else module \
            if isinstance(module, str) else module.__name__
        self.register_namespace(namespace, module)
106202
public function isValid($module, $controller, $action) {
		if (!in_array($module, $this->modules, true)) {
			return self::ROUTE_ERR_MODULE;
		}
		$className = EntryUtil::controller($module, $controller);
		if (!Container::getInstance()->has($className)) {
			return self::ROUTE_ERR_CONTROLLER;
		}
		$clazz = Container::getInstance()->get($className);
		if (!method_exists($clazz, $action . 'Action')) {
			return self::ROUTE_ERR_ACTION;
		}
		return self::ROUTE_VALID;
	}
41444
protected function _addExtensions(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $aModulesDefault = $this->getConfig()->getConfigParam('aModules');
        $aModules = $this->getModulesWithExtendedClass();
        $aModules = $this->_removeNotUsedExtensions($aModules, $module);


        if ($module->hasExtendClass()) {
            $this->validateMetadataExtendSection($module);
            $aAddModules = $module->getExtensions();
            $aModules = $this->_mergeModuleArrays($aModules, $aAddModules);
        }

        $aModules = $this->buildModuleChains($aModules);
        if ($aModulesDefault != $aModules) {
            $this->needCacheClear = true;
            $onlyInAfterFix = array_diff($aModules, $aModulesDefault);
            $onlyInBeforeFix = array_diff($aModulesDefault, $aModules);
            $this->output->writeLn("[INFO] fixing " . $module->getId());
            foreach ($onlyInAfterFix as $core => $ext) {
                if ($oldChain = $onlyInBeforeFix[$core]) {
                    $newExt = substr($ext, strlen($oldChain));
                    if (!$newExt) {
                        //$newExt = substr($ext, strlen($oldChain));
                        $this->output->writeLn("[INFO] remove ext for $core");
                        $this->output->writeLn("[INFO] old: $oldChain");
                        $this->output->writeLn("[INFO] new: $ext");
                        //$this->_debugOutput->writeLn("[ERROR] extension chain is corrupted for this module");
                        //return;
                        continue;
                    } else {
                        $this->output->writeLn("[INFO] append $core => ...$newExt");
                    }
                    unset($onlyInBeforeFix[$core]);
                } else {
                    $this->output->writeLn("[INFO] add $core => $ext");
                }
            }
            foreach ($onlyInBeforeFix as $core => $ext) {
                $this->output->writeLn("[INFO] remove $core => $ext");
            }
            $this->_saveToConfig('aModules', $aModules);
        }
    }
1242698
public function addModule(Module $module)
    {
        if ($this->db !== $module->getDB())
            throw new MigrationException("The DB instances should be the same");

        $name = self::normalizeModule($module->getModule());
        $this->modules[$name] = $module;
        return $this;
    }
547862
def ensure_valid_environment_config(module_name, config):
    """"""
    if not config.get('namespace'):
        LOGGER.fatal("staticsite: module %s's environment configuration is "
                     "missing a namespace definition!",
                     module_name)
        sys.exit(1)
32804
public function isValidModule(string $category, string $class): bool {
        if (isset($this->modules[$category])
          && $class instanceof ModuleInterface) {
            return true;
        }

        return false;
    }
202300
public void addModule(Module module) {
        LOGGER.debug("adding module {}", module);
        module.setupModule(new ModuleContextImpl(module));
        modules.add(module);
    }
992538
public function register_module( \Dekode\Hogan\Module $module ) {

		if ( did_action( 'hogan/modules_included' ) ) {
			_doing_it_wrong( __METHOD__, esc_html__( 'Hogan modules have already been registered. Please do module registration on action hogan/include_modules.', 'hogan-core' ), '1.0.0' );
		}

		$this->_modules[ $module->name ] = $module;
	}
337084
private function validateCoreModuleNames()
    {
        if (!empty($this->coreModules)) {
            $coreBag = $this->getCoreBag();

            if (!$coreBag->hasAllCoreModules()) {
                throw new LogicException(sprintf(
                    'The framework can not start without defined core modules: %s', implode(', ', $coreBag->getMissingCoreModules())
                ));
            }
        }
    }
1278041
public function module($module)
    {
        if (is_object($module)) {
            if (!($module instanceof ModuleInterface)) {
                $moduleType = get_class($module);

                throw new InvalidArgumentException("Given module object '$moduleType' does not implement 'Depend\\Abstraction\\ModuleInterface'");
            }

            $module->register($this);

            return $this;
        }

        if (!class_exists((string) $module)) {
            throw new InvalidArgumentException("Given class name '$module' could not be found");
        }

        return $this->module(new $module);
    }
580230
private function setByModule(string $module) : void
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $module))->parse();
        $fields = $this->getModuleFields($module);

        if (! property_exists($config, 'table')) {
            return;
        }

        if (! property_exists($config->table, 'type')) {
            return;
        }

        if ('module' === $config->table->type) {
            $this->setByTypeModule($module, $fields);
        }

        if ('relation' === $config->table->type) {
            $this->setByTypeRelation($module, $fields);
        }

        if ($module === $this->getTableName()) {
            $this->setByTypeFile($module, $fields);
        }
    }
57131
public function addModule($module)
    {
        if (!($module instanceof ModuleInterface)) {
            $module = new Module($module);
        }

        return ($this->modules[$module->getName()] = $module);
    }
15724
private function _getInvalidExtensions($moduleId)
    {
        $extendedShopClasses = $this->getModuleExtensions($moduleId);
        $invalidModuleClasses = [];

        foreach ($extendedShopClasses as $extendedShopClass => $moduleClasses) {
            foreach ($moduleClasses as $moduleClass) {
                if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($moduleClass)) {
                    /** @var \Composer\Autoload\ClassLoader $composerClassLoader */
                    $composerClassLoader = include VENDOR_PATH . 'autoload.php';
                    if (!$composerClassLoader->findFile($moduleClass)) {
                        $invalidModuleClasses[$extendedShopClass][] = $moduleClass;
                    }
                } else {
                    /** Note: $aDeletedExt is passed by reference */
                    $this->backwardsCompatibleGetInvalidExtensions($moduleClass, $invalidModuleClasses, $extendedShopClass);
                }
            }
        }

        return $invalidModuleClasses;
    }
119989
public function isCoreModule(Module $module)
    {
        $coreModulesByName = $this->getCoreModulesByName();

        return $coreModulesByName->has($module->getLowerName());
    }
180612
private function checkForMissingDependencies($moduleName, DependsOnModule $module)
    {
        $dependencies = $this->getModuleDependencies($module);
        $configuredDependenciesCount = count($this->getConfiguredDependencies($moduleName));

        if ($configuredDependenciesCount < count($dependencies)) {
            $missingDependency = array_keys($dependencies)[$configuredDependenciesCount];

            $message = sprintf(
                "\nThis module depends on %s\n\n\n%s",
                $missingDependency,
                $this->getErrorMessageForDependency($module, $missingDependency)
            );

            throw new ModuleRequireException($moduleName, $message);
        }
    }