File tree Expand file tree Collapse file tree 3 files changed +30
-20
lines changed
src/Module/Repository/Internal/GitLab/Api Expand file tree Collapse file tree 3 files changed +30
-20
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,18 @@ public function getReleases(int $page = 1): Paginator
103103 $ response = $ this ->releasesRequest ($ currentPage );
104104
105105 /** @var array<array-key, array{
106- * name: string|null,
107- * tag_name: string,
108- * released_at: string,
106+ * name: non-empty-string|null,
107+ * tag_name: non-empty-string,
108+ * description: null|non-empty-string,
109+ * created_at: non-empty-string,
110+ * released_at: non-empty-string,
109111 * assets: array{
110112 * links: list<array{
111- * name: string,
112- * url: string,
113- * direct_asset_url: string,
114- * }>
113+ * name: non-empty-string,
114+ * url: non-empty-string,
115+ * direct_asset_url?: non-empty-string,
116+ * link_type: non-empty-string,
117+ * }>
115118 * },
116119 * upcoming_release: bool
117120 * }> $data */
Original file line number Diff line number Diff line change @@ -15,24 +15,28 @@ final class AssetInfo
1515 /**
1616 * @param non-empty-string $name
1717 * @param non-empty-string $downloadUrl
18+ * @param non-empty-string|null $linkType
1819 */
1920 public function __construct (
2021 public readonly string $ name ,
2122 public readonly string $ downloadUrl ,
23+ public readonly ?string $ linkType = null ,
2224 ) {}
2325
2426 /**
2527 * @param array{
26- * name: string,
27- * url: string,
28- * direct_asset_url: string,
28+ * name: non-empty-string,
29+ * url: non-empty-string,
30+ * direct_asset_url?: non-empty-string,
31+ * link_type: non-empty-string,
2932 * } $data
3033 */
3134 public static function fromApiResponse (array $ data ): self
3235 {
3336 return new self (
3437 name: $ data ['name ' ],
35- downloadUrl: $ data ['url ' ],
38+ downloadUrl: !empty ($ data ['direct_asset_url ' ]) ? $ data ['direct_asset_url ' ] : $ data ['url ' ],
39+ linkType: $ data ['link_type ' ] ?? null ,
3640 );
3741 }
3842}
Original file line number Diff line number Diff line change @@ -27,15 +27,18 @@ public function __construct(
2727
2828 /**
2929 * @param array{
30- * name: string|null,
31- * tag_name: string,
32- * released_at: string,
33- * assets: array{
34- * links: list<array{
35- * name: string,
36- * url: string,
37- * direct_asset_url: string,
38- * }>
30+ * name: non-empty-string|null,
31+ * tag_name: non-empty-string,
32+ * description: null|non-empty-string,
33+ * created_at: non-empty-string,
34+ * released_at: non-empty-string,
35+ * assets: array{
36+ * links: list<array{
37+ * name: non-empty-string,
38+ * url: non-empty-string,
39+ * direct_asset_url?: non-empty-string,
40+ * link_type: non-empty-string,
41+ * }>
3942 * },
4043 * upcoming_release: bool
4144 * } $data
You can’t perform that action at this time.
0 commit comments