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

        foreach($component_dependency_map as $component => $depended_components)
        {
            foreach($depended_components as $depended_component)
            {
                $dependency_list = $this->getComponentDependencyList($depended_component, $component_dependency_map, $cyclic_reference_list);

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

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

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

        foreach($component_dependency_map as $component => $depended_components)
        {
            foreach($depended_components as $depended_component)
            {
                $dependency_list = $this->getComponentDependencyList($depended_component, $component_dependency_map, $cyclic_reference_list);

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

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

        return $resolved_module_list;
    }
private function resolveComponentDependencyMap ( array $ component_dependency_map ) : array { $ resolved_module_list = [ ] ; $ cyclic_reference_list = [ ] ; foreach ( $ component_dependency_map as $ component => $ depended_components ) { foreach ( $ depended_components as $ depended_component ) { $ dependency_list = $ this -> getComponentDependencyList ( $ depended_component , $ component_dependency_map , $ cyclic_reference_list ) ; foreach ( $ dependency_list as $ c ) { if ( ! in_array ( $ c , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ c ; } } if ( ! in_array ( $ depended_component , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ depended_component ; } } if ( ! in_array ( $ component , $ resolved_module_list ) ) { $ resolved_module_list [ ] = $ component ; } } return $ resolved_module_list ; }
@param array $component_dependency_map

@return array

@throws CyclicReferencedComponentException
@param array $component_dependency_map