@@ -71,7 +71,10 @@ public static function getUrl(): string
7171 */
7272 public function getUserInfo (): array
7373 {
74- return $ this ->client ->request ('GET ' , '/api/v1/user ' )->toArray ();
74+ /** @var array{id: int, name: string, email: string} $result */
75+ $ result = $ this ->client ->request ('GET ' , '/api/v1/user ' )->toArray ();
76+
77+ return $ result ;
7578 }
7679
7780 /**
@@ -102,9 +105,12 @@ public function createDeployment(string $environment, array $config, string|null
102105 if ($ awsAccountName ) {
103106 $ body ['aws_account_name ' ] = $ awsAccountName ;
104107 }
105- return $ this ->client ->request ('POST ' , '/api/v1/deployments ' , [
108+ /** @var array{deploymentId: int, message: string, url: string, credentials?: array{accessKeyId: string, secretAccessKey: string, sessionToken: string}, packageUrls?: array<string, string>} $result */
109+ $ result = $ this ->client ->request ('POST ' , '/api/v1/deployments ' , [
106110 'json ' => $ body ,
107111 ])->toArray ();
112+
113+ return $ result ;
108114 }
109115
110116 public function startDeployment (int $ deploymentId ): void
@@ -129,7 +135,10 @@ public function startDeployment(int $deploymentId): void
129135 */
130136 public function getDeployment (int $ deploymentId ): array
131137 {
132- return $ this ->client ->request ('GET ' , "/api/v1/deployments/ $ deploymentId " )->toArray ();
138+ /** @var array{deploymentId: int, status: string, message: string, error_message: string|null, url: string, app_url: string|null, logs: list<array{line: string, timestamp: int}>, outputs?: array<string, string>} $result */
139+ $ result = $ this ->client ->request ('GET ' , "/api/v1/deployments/ $ deploymentId " )->toArray ();
140+
141+ return $ result ;
133142 }
134143
135144 public function pushDeploymentLogs (int $ deploymentId , string $ newLogs ): void
@@ -189,7 +198,10 @@ public function markDeploymentFinished(
189198 */
190199 public function getEnvironment (int $ id ): array
191200 {
192- return $ this ->client ->request ('GET ' , '/api/v1/environments/ ' . $ id )->toArray ();
201+ /** @var array{id: int, name: string, region: string|null, url: string|null, outputs: array<string, string>, app: array{id: int, name: string}, aws_account_id: int|null} $result */
202+ $ result = $ this ->client ->request ('GET ' , '/api/v1/environments/ ' . $ id )->toArray ();
203+
204+ return $ result ;
193205 }
194206
195207 /**
@@ -208,11 +220,14 @@ public function getEnvironment(int $id): array
208220 */
209221 public function findEnvironment (string $ teamSlug , string $ appName , string $ environment ): array
210222 {
211- return $ this ->client ->request ('GET ' , '/api/v1/environments/find? ' . http_build_query ([
223+ /** @var array{id: int, name: string, region: string|null, url: string|null, outputs: array<string, string>, app: array{id: int, name: string}, aws_account_id: int|null} $result */
224+ $ result = $ this ->client ->request ('GET ' , '/api/v1/environments/find? ' . http_build_query ([
212225 'teamSlug ' => $ teamSlug ,
213226 'appName ' => $ appName ,
214227 'environmentName ' => $ environment ,
215228 ]))->toArray ();
229+
230+ return $ result ;
216231 }
217232
218233 public function removeEnvironment (int $ environmentId ): void
@@ -245,7 +260,10 @@ public function startCommand(int $environmentId, string $command): int
245260 */
246261 public function getCommand (int $ id ): array
247262 {
248- return $ this ->client ->request ('GET ' , "/api/v1/commands/ $ id " )->toArray ();
263+ /** @var array{status: 'not_started'|'started'|'success'|'failed', output: string} $result */
264+ $ result = $ this ->client ->request ('GET ' , "/api/v1/commands/ $ id " )->toArray ();
265+
266+ return $ result ;
249267 }
250268
251269 /**
@@ -256,7 +274,10 @@ public function getCommand(int $id): array
256274 */
257275 public function listAwsAccounts (): array
258276 {
259- return $ this ->client ->request ('GET ' , '/api/v1/aws-accounts ' )->toArray ();
277+ /** @var list<array{id: int, name: string, role_arn: string, team_id: int}> $result */
278+ $ result = $ this ->client ->request ('GET ' , '/api/v1/aws-accounts ' )->toArray ();
279+
280+ return $ result ;
260281 }
261282
262283 /**
@@ -267,7 +288,10 @@ public function listAwsAccounts(): array
267288 */
268289 public function listTeams (): array
269290 {
270- return $ this ->client ->request ('GET ' , '/api/v1/teams ' )->toArray ();
291+ /** @var list<array{id: int, name: string, slug: string}> $result */
292+ $ result = $ this ->client ->request ('GET ' , '/api/v1/teams ' )->toArray ();
293+
294+ return $ result ;
271295 }
272296
273297 /**
@@ -285,7 +309,10 @@ public function listTeams(): array
285309 */
286310 public function prepareConnectAwsAccount (int $ teamId ): array
287311 {
288- return $ this ->client ->request ('GET ' , '/api/v1/aws-accounts/connect?team_id= ' . $ teamId )->toArray ();
312+ /** @var array{region: string, template_url: string, stack_name: string, bref_cloud_account_id: string, unique_external_id: string, role_name: string|null} $result */
313+ $ result = $ this ->client ->request ('GET ' , '/api/v1/aws-accounts/connect?team_id= ' . $ teamId )->toArray ();
314+
315+ return $ result ;
289316 }
290317
291318 public function addAwsAccount (mixed $ teamId , string $ accountName , string $ roleArn ): void
0 commit comments