/**
* @throws MediaException
*/
private function getUrlFromRequest(Request
$request): string
{ $url =
(string) $request->request->
get('url'
);
if ($url === ''
) { throw MediaException::
missingUrlParameter();
} if (!
$this->
isUrlValid($url)) { throw MediaException::
invalidUrl($url);
} return $url;
} /**
* @throws MediaException
*
* @return resource
*/