public function guessExtensionNameFromManifest(string $manifest, string $path): ?string
    {
        if (\rtrim($this->config['path.app'], '/') === \rtrim($path, '/')) {
            return 'app';
        }

        list($vendor, $package) = $namespace = $this->resolveExtensionNamespace($manifest);

        if (\is_null($vendor) && \is_null($package)) {
            return null;
        }

        // Each package should have vendor/package name pattern.
        $name = \trim(\implode('/', $namespace));

        return $this->validateExtensionName($name);
    }