Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ditsuke committed Feb 3, 2022
1 parent a38ebd2 commit 59057c7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions plugins/task/requests/requests.php
Expand Up @@ -87,13 +87,13 @@ protected function makeGetRequest(ExecuteTaskEvent $event): int
$id = $event->getTaskId();
$params = $event->getArgument('params');

$url = $params->url;
$timeout = $params->timeout;
$auth = ($params->auth ?? 0) === 1;
$authType = (string) $params->authType ?? '';
$authKey = (string) $params->authKey ?? '';
$url = $params->url;
$timeout = $params->timeout;
$auth = ($params->auth ?? 0) === 1;
$authType = (string) $params->authType ?? '';
$authKey = (string) $params->authKey ?? '';
$saveResponse = ($params->saveResponse ?? 0) === 1;
$headers = [];
$headers = [];

if ($auth && $authType && $authKey)
{
Expand Down Expand Up @@ -125,7 +125,8 @@ protected function makeGetRequest(ExecuteTaskEvent $event): int
}

$responseStatus = $saveResponse && $responseSaved ? 'SAVED' : 'NOT_SAVED';
$this->snapshot['output'] = <<< EOF

$this->snapshot['output'] = <<< EOF
======= Task Output Body =======
> URL: $url
> Response Code: $responseCode
Expand All @@ -146,9 +147,9 @@ protected function makeGetRequest(ExecuteTaskEvent $event): int
* Save request response to task snapshot.
*
* @param integer $taskId ID of the task spawning the request routine.
* @param string $url Request URL.
* @param string $url Request URL.
* @param integer $responseCode Request response code.
* @param string $responseBody Response body.
* @param string $responseBody Response body.
*
*
* @return boolean Returns false on failure to save the response.
Expand All @@ -158,7 +159,7 @@ protected function makeGetRequest(ExecuteTaskEvent $event): int
*/
protected function saveResponse(int $taskId, string $url, int $responseCode, string $responseBody): bool
{
$tmpdir = $this->app->getConfig()->get('tmp_path');
$tmpdir = $this->app->getConfig()->get('tmp_path');
$responseFilename = Path::check("${tmpdir}/task_{$taskId}_GET_response.html");

if (File::write($responseFilename, $responseBody))
Expand Down

0 comments on commit 59057c7

Please sign in to comment.