private function getBasePathForClass($name, $namespace, $path)
    {
        $namespace   = str_replace('\\', '/', $namespace);
        $search      = str_replace('\\', '/', $path);
        $destination = str_replace('/' . $namespace, '', $search, $c);

        if ($c !== 1) {
            throw new RuntimeException(sprintf('Can\'t find base path for "%s" (path: "%s", destination: "%s").', $name, $path, $destination));
        }

        return $destination;
    }
private function getBasePathForClass($name, $namespace, $path)
    {
        $namespace   = str_replace('\\', '/', $namespace);
        $search      = str_replace('\\', '/', $path);
        $destination = str_replace('/' . $namespace, '', $search, $c);

        if ($c !== 1) {
            throw new RuntimeException(sprintf('Can\'t find base path for "%s" (path: "%s", destination: "%s").', $name, $path, $destination));
        }

        return $destination;
    }
private function getBasePathForClass ( $ name , $ namespace , $ path ) { $ namespace = str_replace ( '\\' , '/' , $ namespace ) ; $ search = str_replace ( '\\' , '/' , $ path ) ; $ destination = str_replace ( '/' . $ namespace , '' , $ search , $ c ) ; if ( $ c !== 1 ) { throw new RuntimeException ( sprintf ( 'Can\'t find base path for "%s" (path: "%s", destination: "%s").' , $ name , $ path , $ destination ) ) ; } return $ destination ; }
Get a base path for a class

@param string $name      class name
@param string $namespace class namespace
@param string $path      class path

@return string

@throws RuntimeException When base path not found.
Get a base path for a class