protected static function getNamespacePaths($namespace) {
        $paths = [];
        $namespace = trim($namespace, static::CS);
        $nsPrefixes = static::getNamespacePrefixes($namespace);
        $nsPrefixesCount = count($nsPrefixes);
        $loaderPrefixes = static::getLoaderPrefixes();
        $nsPrefix = null;
        for ($i = 0; $i < $nsPrefixesCount; $i++) {
            $nsPrefix = $nsPrefixes[$i];
            if (!isset($loaderPrefixes[$nsPrefix])) {
                continue;
            }
            if ($nsPrefix === $namespace) {
                return $loaderPrefixes[$nsPrefix];
            }
            $nsSuffix = trim(substr($namespace, strlen($nsPrefix)), static::CS);
            $nsSuffix = str_replace(static::CS, static::DS, $nsSuffix);
            $loaderPaths = $loaderPrefixes[$nsPrefix];
            $loaderPathsCount = count($loaderPaths);
            for ($j = 0; $j < $loaderPathsCount; $j++) {
                $possiblePath = $loaderPaths[$j] . static::DS . $nsSuffix;
                if(file_exists($possiblePath) && is_dir($possiblePath)) { $paths[] = $possiblePath; }
            }
            if (!empty($paths)) {
                break;
            }
        }
        if (empty($paths)) {
            return [null, []];
        }

        return [$nsPrefix, $paths];
    }
protected static function getNamespacePaths($namespace) {
        $paths = [];
        $namespace = trim($namespace, static::CS);
        $nsPrefixes = static::getNamespacePrefixes($namespace);
        $nsPrefixesCount = count($nsPrefixes);
        $loaderPrefixes = static::getLoaderPrefixes();
        $nsPrefix = null;
        for ($i = 0; $i < $nsPrefixesCount; $i++) {
            $nsPrefix = $nsPrefixes[$i];
            if (!isset($loaderPrefixes[$nsPrefix])) {
                continue;
            }
            if ($nsPrefix === $namespace) {
                return $loaderPrefixes[$nsPrefix];
            }
            $nsSuffix = trim(substr($namespace, strlen($nsPrefix)), static::CS);
            $nsSuffix = str_replace(static::CS, static::DS, $nsSuffix);
            $loaderPaths = $loaderPrefixes[$nsPrefix];
            $loaderPathsCount = count($loaderPaths);
            for ($j = 0; $j < $loaderPathsCount; $j++) {
                $possiblePath = $loaderPaths[$j] . static::DS . $nsSuffix;
                if(file_exists($possiblePath) && is_dir($possiblePath)) { $paths[] = $possiblePath; }
            }
            if (!empty($paths)) {
                break;
            }
        }
        if (empty($paths)) {
            return [null, []];
        }

        return [$nsPrefix, $paths];
    }
protected static function getNamespacePaths ( $ namespace ) { $ paths = [ ] ; $ namespace = trim ( $ namespace , static :: CS ) ; $ nsPrefixes = static :: getNamespacePrefixes ( $ namespace ) ; $ nsPrefixesCount = count ( $ nsPrefixes ) ; $ loaderPrefixes = static :: getLoaderPrefixes ( ) ; $ nsPrefix = null ; for ( $ i = 0 ; $ i < $ nsPrefixesCount ; $ i ++ ) { $ nsPrefix = $ nsPrefixes [ $ i ] ; if ( ! isset ( $ loaderPrefixes [ $ nsPrefix ] ) ) { continue ; } if ( $ nsPrefix === $ namespace ) { return $ loaderPrefixes [ $ nsPrefix ] ; } $ nsSuffix = trim ( substr ( $ namespace , strlen ( $ nsPrefix ) ) , static :: CS ) ; $ nsSuffix = str_replace ( static :: CS , static :: DS , $ nsSuffix ) ; $ loaderPaths = $ loaderPrefixes [ $ nsPrefix ] ; $ loaderPathsCount = count ( $ loaderPaths ) ; for ( $ j = 0 ; $ j < $ loaderPathsCount ; $ j ++ ) { $ possiblePath = $ loaderPaths [ $ j ] . static :: DS . $ nsSuffix ; if ( file_exists ( $ possiblePath ) && is_dir ( $ possiblePath ) ) { $ paths [ ] = $ possiblePath ; } } if ( ! empty ( $ paths ) ) { break ; } } if ( empty ( $ paths ) ) { return [ null , [ ] ] ; } return [ $ nsPrefix , $ paths ] ; }
Get possible namespace paths
@param string $namespace
@return array|mixed
Get possible namespace paths