public function getPathForFutureClass(string $className)
    {
        $classLoader = $this->getClassLoader();

        // lookup is obviously modeled off of Composer's autoload logic
        foreach ($classLoader->getPrefixesPsr4() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', substr($className, \strlen($prefix))).'.php';
            }
        }

        foreach ($classLoader->getPrefixes() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', $className).'.php';
            }
        }

        if ($classLoader->getFallbackDirsPsr4()) {
            return $classLoader->getFallbackDirsPsr4()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        if ($classLoader->getFallbackDirs()) {
            return $classLoader->getFallbackDirs()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        return null;
    }
public function getPathForFutureClass(string $className)
    {
        $classLoader = $this->getClassLoader();

        // lookup is obviously modeled off of Composer's autoload logic
        foreach ($classLoader->getPrefixesPsr4() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', substr($className, \strlen($prefix))).'.php';
            }
        }

        foreach ($classLoader->getPrefixes() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', $className).'.php';
            }
        }

        if ($classLoader->getFallbackDirsPsr4()) {
            return $classLoader->getFallbackDirsPsr4()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        if ($classLoader->getFallbackDirs()) {
            return $classLoader->getFallbackDirs()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        return null;
    }
public function getPathForFutureClass ( string $ className ) { $ classLoader = $ this -> getClassLoader ( ) ; // lookup is obviously modeled off of Composer's autoload logic foreach ( $ classLoader -> getPrefixesPsr4 ( ) as $ prefix => $ paths ) { if ( 0 === strpos ( $ className , $ prefix ) ) { return $ paths [ 0 ] . '/' . str_replace ( '\\' , '/' , substr ( $ className , \ strlen ( $ prefix ) ) ) . '.php' ; } } foreach ( $ classLoader -> getPrefixes ( ) as $ prefix => $ paths ) { if ( 0 === strpos ( $ className , $ prefix ) ) { return $ paths [ 0 ] . '/' . str_replace ( '\\' , '/' , $ className ) . '.php' ; } } if ( $ classLoader -> getFallbackDirsPsr4 ( ) ) { return $ classLoader -> getFallbackDirsPsr4 ( ) [ 0 ] . '/' . str_replace ( '\\' , '/' , $ className ) . '.php' ; } if ( $ classLoader -> getFallbackDirs ( ) ) { return $ classLoader -> getFallbackDirs ( ) [ 0 ] . '/' . str_replace ( '\\' , '/' , $ className ) . '.php' ; } return null ; }
Returns the relative path to where a new class should live.

@param string $className

@return string|null

@throws \Exception
Returns the relative path to where a new class should live .