public function createAutoloader($vendorDir = null)
    {
        if (! $vendorDir) {
            $vendorDir = __DIR__ . '/../../vendor';
        }

        $autoloader_location = $vendorDir . '/autoload.php';
        if (! file_exists($autoloader_location) || ! is_readable($autoloader_location)) {
            throw new \RuntimeException(
                'phpDocumentor expected to find an autoloader at "' . $autoloader_location . '" but it was not there. '
                . 'Usually this is because the "composer install" command has not been ran yet. If this is not the '
                . 'case, please open an issue at http://github.com/phpDocumentor/phpDocumentor2 detailing what '
                . 'installation method you used, which path is mentioned in this error message and any other relevant '
                . 'information.'
            );
        }

        return require $autoloader_location;
    }