registry = $registry; $this->url = $url; $this->dom = new Dom; $this->dom->loadFromUrl($url); } public function download($url, $dir = null, $filename = null): ?Asset { $info = parse_url($url); if (empty($info['host'])) { $url = 'https://' . Str::replace('//', '/', "www.faufcc.ru/{$url}"); } return (new FileDownloadService())->download($url, $dir, $filename); } }