src/Application.php
public final function registerModule(Module $module)
    {
        $dependencies = $module->getModules();

        foreach($dependencies as $dependency){
            $this->registerModule($dependency);
        }

        $this->modules[$module->getModuleName()] = $module;
    }
public final function registerModule(Module $module)
    {
        $dependencies = $module->getModules();

        foreach($dependencies as $dependency){
            $this->registerModule($dependency);
        }

        $this->modules[$module->getModuleName()] = $module;
    }
public final function registerModule ( Module $ module ) { $ dependencies = $ module -> getModules ( ) ; foreach ( $ dependencies as $ dependency ) { $ this -> registerModule ( $ dependency ) ; } $ this -> modules [ $ module -> getModuleName ( ) ] = $ module ; }
Register a module with the application.

Also registers the dependencies of the application also

@param Module $module
Register a module with the application .