Apply fixes from StyleCI (#12124)

This commit is contained in:
Jellyfrog
2020-09-21 15:59:34 +02:00
committed by GitHub
parent 0d56bbd946
commit 29f45ca352
816 changed files with 5038 additions and 5038 deletions

View File

@@ -76,8 +76,8 @@ class Prometheus extends BaseDatastore
}
try {
$vals = "";
$promtags = "/measurement/" . $measurement;
$vals = '';
$promtags = '/measurement/' . $measurement;
foreach ($fields as $k => $v) {
if ($v !== null) {
@@ -87,7 +87,7 @@ class Prometheus extends BaseDatastore
foreach ($tags as $t => $v) {
if ($v !== null) {
$promtags .= (Str::contains($v, "/") ? "/$t@base64/" . base64_encode($v) : "/$t/$v");
$promtags .= (Str::contains($v, '/') ? "/$t@base64/" . base64_encode($v) : "/$t/$v");
}
}
$options = $this->getDefaultOptions();
@@ -97,7 +97,7 @@ class Prometheus extends BaseDatastore
if (Config::get('prometheus.attach_sysname', false)) {
$promurl .= '/sysName/' . $device['sysName'];
}
$promurl = str_replace(" ", "-", $promurl); // Prometheus doesn't handle tags with spaces in url
$promurl = str_replace(' ', '-', $promurl); // Prometheus doesn't handle tags with spaces in url
Log::debug("Prometheus put $promurl: ", [
'measurement' => $measurement,
@@ -114,7 +114,7 @@ class Prometheus extends BaseDatastore
Log::error('Prometheus Error: ' . $result->getReasonPhrase());
}
} catch (GuzzleException $e) {
Log::error("Prometheus Exception: " . $e->getMessage());
Log::error('Prometheus Exception: ' . $e->getMessage());
}
}