public function find($basePath)
    {
        if (is_file($basePath)) {
            $basePath = dirname($basePath);
        } elseif (!is_dir($basePath)) {
            throw new \InvalidArgumentException('Base path must be either a file path or directory');
        }

        $basePath = realpath($basePath) ?: $basePath;

        do {
            $autoloaderPath = $this->containsKnownAutoloader($basePath);
            if ($autoloaderPath !== '') {
                return $autoloaderPath;
            }
            $basePath = dirname($basePath);
        } while ($basePath && $basePath !== '/');

        return '';
    }