protected function getCurlCommand()
{
$command = [];
$command[] = 'curl';
foreach ($this->headers as $key => $header) {
if (!is_int($key)) {
throw new \InvalidArgumentException("Don't use an associative array. Pass headers like this: [ 'Host: myhost', 'X-Forwarded-Proto: https']");
}
$command[] = "--header '{$header}'";
}
$command[] = '--insecure';
$command[] = '--silent';
if ($this->maxTime) {
$command[] = '--max-time ' . $this->maxTime;
}
if ($this->postData) {
$command[] = '--data "' . $this->postData . '"';
}
$command[] = '--dump-header /dev/stdout';
$command[] = '--user-agent AwsInspectorCurl';
$command[] = escapeshellarg($this->url);
return implode(' ', $command);
}