format files in app, src, tests

This commit is contained in:
Everly Precia Suresh
2022-05-23 14:54:50 +00:00
parent 902e74a943
commit 19300ccdd7
237 changed files with 2502 additions and 2364 deletions
+18 -18
View File
@@ -36,9 +36,9 @@ class Executor
/**
* Create runtime
*
*
* Launches a runtime container for a deployment ready for execution
*
*
* @param string $deploymentId
* @param string $projectId
* @param string $source
@@ -53,10 +53,10 @@ class Executor
* @param array $commands
*/
public function createRuntime(
string $deploymentId,
string $projectId,
string $deploymentId,
string $projectId,
string $source,
string $runtime,
string $runtime,
string $baseImage,
bool $remove = false,
string $entrypoint = '',
@@ -90,16 +90,16 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception($response['body']['message'], $status);
}
}
return $response['body'];
}
/**
* Delete Runtime
*
*
* Deletes a runtime and cleans up any containers remaining.
*
*
* @param string $projectId
* @param string $deploymentId
*/
@@ -115,7 +115,7 @@ class Executor
$params = [];
$response = $this->call(self::METHOD_DELETE, $route, $headers, $params, true, 30);
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception($response['body']['message'], $status);
@@ -126,7 +126,7 @@ class Executor
/**
* Create an execution
*
*
* @param string $projectId
* @param string $deploymentId
* @param string $path
@@ -136,7 +136,7 @@ class Executor
* @param string runtime
* @param string $baseImage
* @param int $timeout
*
*
* @return array
*/
public function createExecution(
@@ -157,7 +157,7 @@ class Executor
];
$params = [
'runtimeId' => "$projectId-$deploymentId",
'vars' => $vars,
'vars' => $vars,
'data' => $data,
'timeout' => $timeout,
];
@@ -248,7 +248,7 @@ class Executor
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) {
$len = strlen($header);
@@ -277,18 +277,18 @@ class Executor
$responseType = $responseHeaders['content-type'] ?? '';
$responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($decode) {
if ($decode) {
switch (substr($responseType, 0, strpos($responseType, ';'))) {
case 'application/json':
$json = json_decode($responseBody, true);
if ($json === null) {
throw new Exception('Failed to parse response: '.$responseBody);
throw new Exception('Failed to parse response: ' . $responseBody);
}
$responseBody = $json;
$json = null;
break;
break;
}
}