'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'pdf' => 'application/pdf', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'jpg' => 'image/jpg' ]; public function __construct(Registry $registry, string $url) { $this->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); } }