private function generateUrl($url)
    {
        if ($this->packages) {
            return $this->packages->getUrl($url);
        }

        if ($this->coreAssetsHelper) {
            // To remove when compatibility with Symfony 2.7 is dropped
            return $this->coreAssetsHelper->getUrl($url);
        }

        return $url;
    }