diff --git a/library/Perfdatagraphsprometheus/Client/Prometheus.php b/library/Perfdatagraphsprometheus/Client/Prometheus.php index 89882cf..a95967c 100644 --- a/library/Perfdatagraphsprometheus/Client/Prometheus.php +++ b/library/Perfdatagraphsprometheus/Client/Prometheus.php @@ -23,7 +23,7 @@ class Prometheus protected const QUERYRANGE_ENDPOINT = '/api/v1/query_range'; /** @var $this \Icinga\Application\Modules\Module */ - protected $client = null; + protected Client $client; protected string $URL; protected int $maxDataPoints; diff --git a/library/Perfdatagraphsprometheus/Client/Transformer.php b/library/Perfdatagraphsprometheus/Client/Transformer.php index 2825fbe..919ab9c 100644 --- a/library/Perfdatagraphsprometheus/Client/Transformer.php +++ b/library/Perfdatagraphsprometheus/Client/Transformer.php @@ -22,14 +22,10 @@ class Transformer * output format we need. * * @param GuzzleHttp\Psr7\Response $response the data to transform - * @param array $includeMetrics metrics to include in the response - * @param array $excludeMetrics metrics to exlude from the response * @return PerfdataResponse */ - public static function transform( - Response $response, - array $excludeMetrics = [], - ): PerfdataResponse { + public static function transform(Response $response): PerfdataResponse + { $pfr = new PerfdataResponse(); if (empty($response)) { @@ -40,7 +36,7 @@ public static function transform( $body = json_decode($response->getBody()->getContents(), true); if ($body['status'] !== 'success') { - $perfdataresponse->addError($body['error'] ?? 'unknown error'); + $pfr->addError($body['error'] ?? 'unknown error'); return $pfr; }