function setDirMap(array $moduleMap)
    {
        if(!empty($moduleMap) && array_values($moduleMap) === $moduleMap)
            throw new \Exception('Module map must be associative array, module name and class map.');

        foreach($moduleMap as $m => $v) {
            if (strstr($v, '/') !== false || strstr($v, '\\') !== false) {
                // module names in Namespace\To\Module\Style
                $v = rtrim($v, "\\/");
                $v = str_replace('\\', '/', $v);

                $moduleMap[$m] = $v;
            }
        }

        $this->dirMap = array_merge($this->dirMap, $moduleMap);
        return $this;
    }
function setDirMap(array $moduleMap)
    {
        if(!empty($moduleMap) && array_values($moduleMap) === $moduleMap)
            throw new \Exception('Module map must be associative array, module name and class map.');

        foreach($moduleMap as $m => $v) {
            if (strstr($v, '/') !== false || strstr($v, '\\') !== false) {
                // module names in Namespace\To\Module\Style
                $v = rtrim($v, "\\/");
                $v = str_replace('\\', '/', $v);

                $moduleMap[$m] = $v;
            }
        }

        $this->dirMap = array_merge($this->dirMap, $moduleMap);
        return $this;
    }
function setDirMap ( array $ moduleMap ) { if ( ! empty ( $ moduleMap ) && array_values ( $ moduleMap ) === $ moduleMap ) throw new \ Exception ( 'Module map must be associative array, module name and class map.' ) ; foreach ( $ moduleMap as $ m => $ v ) { if ( strstr ( $ v , '/' ) !== false || strstr ( $ v , '\\' ) !== false ) { // module names in Namespace\To\Module\Style $ v = rtrim ( $ v , "\\/" ) ; $ v = str_replace ( '\\' , '/' , $ v ) ; $ moduleMap [ $ m ] = $ v ; } } $ this -> dirMap = array_merge ( $ this -> dirMap , $ moduleMap ) ; return $ this ; }
Set Module Name Dir Map

- used to resolve module name instance

note: modules map has higher priority on resolve
module instance

@param array $moduleMap Associative Module Name And ClassMap

@throws \Exception
@return $this
Set Module Name Dir Map