src/ModuleDependencyResolver.php
private function resolveModuleDependencyMap(array $module_dependency_map) : array
    {
        $resolved_module_list = [];
        $cyclic_reference_list = [];

        foreach($module_dependency_map as $module => $depended_modules)
        {
            foreach($depended_modules as $depended_module)
            {
                $dependency_list = $this->getModuleDependencyList($depended_module, $module_dependency_map, $cyclic_reference_list);

                foreach($dependency_list as $m)
                {
                    if (!in_array($m, $resolved_module_list)) {
                        $resolved_module_list[] = $m;
                    }
                }
                if (!in_array($depended_module, $resolved_module_list)){
                    $resolved_module_list[] = $depended_module;
                }
            }

            if (!in_array($module, $resolved_module_list)){
                $resolved_module_list[] = $module;
            }
        }

        return $resolved_module_list;
    }
private function resolveModuleDependencyMap(array $module_dependency_map) : array
    {
        $resolved_module_list = [];
        $cyclic_reference_list = [];

        foreach($module_dependency_map as $module => $depended_modules)
        {
            foreach($depended_modules as $depended_module)
            {
                $dependency_list = $this->getModuleDependencyList($depended_module, $module_dependency_map, $cyclic_reference_list);

                foreach($dependency_list as $m)
                {
                    if (!in_array($m, $resolved_module_list)) {
                        $resolved_module_list[] = $m;
                    }
                }
                if (!in_array($depended_module, $resolved_module_list)){
                    $resolved_module_list[] = $depended_module;
                }
            }

            if (!in_array($module, $resolved_module_list)){
                $resolved_module_list[] = $module;
            }
        }

        return $resolved_module_list;
    }
private function resolveModuleDependencyMap ( array $ module_dependency_map ) : array { $ resolved_module_list = [ ] ; $ cyclic_reference_list = [ ] ; foreach ( $ module_dependency_map as $ module => $ depended_modules ) { foreach ( $ depended_modules as $ depended_module ) { $ dependency_list = $ this -> getModuleDependencyList ( $ depended_module , $ module_dependency_map , $ cyclic_reference_list ) ; foreach ( $ dependency_list as $ m ) { if ( ! in_array ( $ m , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ m ; } } if ( ! in_array ( $ depended_module , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ depended_module ; } } if ( ! in_array ( $ module , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ module ; } } return $ resolved_module_list ; }
@param array $module_dependency_map

@return array

@throws CyclicReferencedModuleException
@param array $module_dependency_map