mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#12124)
This commit is contained in:
@@ -52,16 +52,16 @@ class Jira extends Transport
|
||||
$password = $opts['password'];
|
||||
$prjkey = $opts['prjkey'];
|
||||
$issuetype = $opts['issuetype'];
|
||||
$details = "Librenms alert for: " . $obj['hostname'];
|
||||
$details = 'Librenms alert for: ' . $obj['hostname'];
|
||||
$description = $obj['msg'];
|
||||
$url = $opts['url'] . '/rest/api/latest/issue';
|
||||
$curl = curl_init();
|
||||
|
||||
$data = ["project" => ["key" => $prjkey],
|
||||
"summary" => $details,
|
||||
"description" => $description,
|
||||
"issuetype" => ["name" => $issuetype], ];
|
||||
$postdata = ["fields" => $data];
|
||||
$data = ['project' => ['key' => $prjkey],
|
||||
'summary' => $details,
|
||||
'description' => $description,
|
||||
'issuetype' => ['name' => $issuetype], ];
|
||||
$postdata = ['fields' => $data];
|
||||
$datastring = json_encode($postdata);
|
||||
|
||||
set_curl_proxy($curl);
|
||||
@@ -71,7 +71,7 @@ class Jira extends Transport
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
|
||||
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_VERBOSE, 1);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $datastring);
|
||||
@@ -80,11 +80,11 @@ class Jira extends Transport
|
||||
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
if ($code == 200) {
|
||||
$jiraout = json_decode($ret, true);
|
||||
d_echo("Created jira issue " . $jiraout['key'] . " for " . $device);
|
||||
d_echo('Created jira issue ' . $jiraout['key'] . ' for ' . $device);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
d_echo("Jira connection error: " . serialize($ret));
|
||||
d_echo('Jira connection error: ' . serialize($ret));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user