22
33namespace App \Service ;
44
5- use App \DTO \DownloadDescription ;
6- use App \DTO \GameExtra ;
5+ use App \DTO \DownloadableItem ;
76use Symfony \Component \HttpClient \Exception \ClientException ;
87use Symfony \Component \HttpFoundation \Request ;
98use Symfony \Component \HttpFoundation \Response ;
@@ -21,7 +20,7 @@ public function __construct(
2120 }
2221
2322 public function getDownloadUrl (
24- DownloadDescription | GameExtra $ download
23+ DownloadableItem $ download
2524 ): string {
2625 if (str_starts_with ($ download ->url , '/ ' )) {
2726 return self ::BASE_URL . $ download ->url ;
@@ -30,8 +29,8 @@ public function getDownloadUrl(
3029 }
3130
3231 public function getFilename (
33- DownloadDescription | GameExtra $ download ,
34- int $ httpTimeout = 3
32+ DownloadableItem $ download ,
33+ int $ httpTimeout = 3
3534 ): ?string {
3635 $ url = $ this ->getRealDownloadUrl ($ download , $ httpTimeout );
3736 if (!$ url ) {
@@ -42,11 +41,11 @@ public function getFilename(
4241 }
4342
4443 public function download (
45- DownloadDescription | GameExtra $ download ,
46- callable $ callback ,
47- ?int $ startAt = null ,
48- int $ httpTimeout = 3 ,
49- array $ curlOptions = [],
44+ DownloadableItem $ download ,
45+ callable $ callback ,
46+ ?int $ startAt = null ,
47+ int $ httpTimeout = 3 ,
48+ array $ curlOptions = [],
5049 ): ResponseStreamInterface {
5150 $ url = $ this ->getRealDownloadUrl ($ download , $ httpTimeout );
5251
@@ -72,8 +71,8 @@ public function download(
7271 }
7372
7473 private function getRealDownloadUrl (
75- DownloadDescription | GameExtra $ download ,
76- int $ httpTimeout = 3
74+ DownloadableItem $ download ,
75+ int $ httpTimeout = 3
7776 ): ?string {
7877 if (str_starts_with ($ download ->url , '/ ' )) {
7978 $ response = $ this ->httpClient ->request (
0 commit comments