src/Jit/ClassLoader.php
public function findPath($namespace, $forceDir = false)
    {
        $paths = static::prefixes();
        $logicalPath = trim(strtr($namespace, '\\', DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR);

        foreach ($paths as $prefix => $dirs) {
            if (strpos($namespace, $prefix) !== 0) {
                continue;
            }
            foreach ($dirs as $dir) {
                $root = $dir . DIRECTORY_SEPARATOR . substr($logicalPath, strlen($prefix));

                if ($path = $this->_path($root, $forceDir)) {
                    return realpath($path);
                }
            }
        }
    }
public function findPath($namespace, $forceDir = false)
    {
        $paths = static::prefixes();
        $logicalPath = trim(strtr($namespace, '\\', DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR);

        foreach ($paths as $prefix => $dirs) {
            if (strpos($namespace, $prefix) !== 0) {
                continue;
            }
            foreach ($dirs as $dir) {
                $root = $dir . DIRECTORY_SEPARATOR . substr($logicalPath, strlen($prefix));

                if ($path = $this->_path($root, $forceDir)) {
                    return realpath($path);
                }
            }
        }
    }
public function findPath ( $ namespace , $ forceDir = false ) { $ paths = static :: prefixes ( ) ; $ logicalPath = trim ( strtr ( $ namespace , '\\' , DIRECTORY_SEPARATOR ) , DIRECTORY_SEPARATOR ) ; foreach ( $ paths as $ prefix => $ dirs ) { if ( strpos ( $ namespace , $ prefix ) !== 0 ) { continue ; } foreach ( $ dirs as $ dir ) { $ root = $ dir . DIRECTORY_SEPARATOR . substr ( $ logicalPath , strlen ( $ prefix ) ) ; if ( $ path = $ this -> _path ( $ root , $ forceDir ) ) { return realpath ( $ path ) ; } } } }
Returns the path of a namespace or fully namespaced class name.

@param  string      $namespace A namespace.
@param  boolean     $forceDir  Only consider directories paths.
@return string|null            Returns the found path or `null` if not path is found.
Returns the path of a namespace or fully namespaced class name .