public function readNeedMeDependencies()
    {
        foreach ($this->modules as $readModuleName => $module) {
            $loadInfos = $module->getLoadInfos();
            
            if (!property_exists($loadInfos, 'needMe')) {
                continue;
            }
            
            $needMe = (array) $loadInfos->needMe;
            foreach ($needMe as $needModuleName) {
                if (!isset($this->modules[$needModuleName])) {
                    throw new Exception(
                        'Module error: '.$readModuleName
                        .' need '.$needModuleName
                        .' but the module has not been found.',
                        $this::ERR_NEEDED_NOT_FOUND
                    );
                }
                
                $this->modules[$needModuleName]->addDependency(
                    $readModuleName
                );
            }
        }
    }
public function readNeedMeDependencies()
    {
        foreach ($this->modules as $readModuleName => $module) {
            $loadInfos = $module->getLoadInfos();
            
            if (!property_exists($loadInfos, 'needMe')) {
                continue;
            }
            
            $needMe = (array) $loadInfos->needMe;
            foreach ($needMe as $needModuleName) {
                if (!isset($this->modules[$needModuleName])) {
                    throw new Exception(
                        'Module error: '.$readModuleName
                        .' need '.$needModuleName
                        .' but the module has not been found.',
                        $this::ERR_NEEDED_NOT_FOUND
                    );
                }
                
                $this->modules[$needModuleName]->addDependency(
                    $readModuleName
                );
            }
        }
    }
public function readNeedMeDependencies ( ) { foreach ( $ this -> modules as $ readModuleName => $ module ) { $ loadInfos = $ module -> getLoadInfos ( ) ; if ( ! property_exists ( $ loadInfos , 'needMe' ) ) { continue ; } $ needMe = ( array ) $ loadInfos -> needMe ; foreach ( $ needMe as $ needModuleName ) { if ( ! isset ( $ this -> modules [ $ needModuleName ] ) ) { throw new Exception ( 'Module error: ' . $ readModuleName . ' need ' . $ needModuleName . ' but the module has not been found.' , $ this :: ERR_NEEDED_NOT_FOUND ) ; } $ this -> modules [ $ needModuleName ] -> addDependency ( $ readModuleName ) ; } } }
Read the "needMe" property for each module and add the dependency

@throws \Exception If the dependency is not found

@return void
Read the needMe property for each module and add the dependency