public function getAssetUrl($path, $packageName = null): string
    {
        if (null !== $theme = $this->kernel->getThemes()[$this->activeTheme->getName()] ?? null) {
            $parentTheme = $theme->getParent();

            $assetPath = sprintf('%s/%s/%s', HarmonyThemeBundle::THEMES_DIR, $theme->getShortName(), $path);

            // Asset exists in current active theme
            if (\file_exists(sprintf('%s/public/%s', $this->kernel->getProjectDir(), $assetPath))) {
                return parent::getAssetUrl($assetPath, $packageName);
            } // Has a parent theme
            elseif (null !== $parentTheme && \file_exists(sprintf('%s/public/%s', $this->kernel->getProjectDir(),
                    $parentAssetPath = sprintf('%s/%s/%s', HarmonyThemeBundle::THEMES_DIR, $parentTheme->getShortName(),
                        $path)))) {
                return parent::getAssetUrl($parentAssetPath, $packageName);
            }
        }

        return parent::getAssetUrl($path, $packageName);
    }
public function getAssetUrl($path, $packageName = null): string
    {
        if (null !== $theme = $this->kernel->getThemes()[$this->activeTheme->getName()] ?? null) {
            $parentTheme = $theme->getParent();

            $assetPath = sprintf('%s/%s/%s', HarmonyThemeBundle::THEMES_DIR, $theme->getShortName(), $path);

            // Asset exists in current active theme
            if (\file_exists(sprintf('%s/public/%s', $this->kernel->getProjectDir(), $assetPath))) {
                return parent::getAssetUrl($assetPath, $packageName);
            } // Has a parent theme
            elseif (null !== $parentTheme && \file_exists(sprintf('%s/public/%s', $this->kernel->getProjectDir(),
                    $parentAssetPath = sprintf('%s/%s/%s', HarmonyThemeBundle::THEMES_DIR, $parentTheme->getShortName(),
                        $path)))) {
                return parent::getAssetUrl($parentAssetPath, $packageName);
            }
        }

        return parent::getAssetUrl($path, $packageName);
    }
Returns the public url/path of an asset.
If the package used to generate the path is an instance of
UrlPackage, you will always get a URL and not a path.

@param string $path        A public path
@param string $packageName The name of the asset package to use

@return string The public path of the asset