mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixes minor violations
* Removed unsed `use` statemment * Moved helper http url composer to `GuzzleAdapter` (responsibility) * Removed unused `clearTimePrecision` method * Updated composer
This commit is contained in:
46
composer.lock
generated
46
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "96faa156d58fde5c5c3cf3df60d74ae1",
|
||||
"hash": "61a6988d1b757bb9d3a074d156d73f9d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
@@ -685,16 +685,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "2.1.3",
|
||||
"version": "2.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "28a6b34e91d789b2608072ab3c82eaae7cdb973c"
|
||||
"reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/28a6b34e91d789b2608072ab3c82eaae7cdb973c",
|
||||
"reference": "28a6b34e91d789b2608072ab3c82eaae7cdb973c",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be2286cb8c7e1773eded49d9719219e6f74f9e3e",
|
||||
"reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -743,7 +743,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-06-03 07:01:01"
|
||||
"time": "2015-06-09 13:05:42"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -931,16 +931,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.6.10",
|
||||
"version": "4.7.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "7b5fe98b28302a8b25693b2298bca74463336975"
|
||||
"reference": "41fea1e84ed84d373f5ac099a1276c4358c90708"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b5fe98b28302a8b25693b2298bca74463336975",
|
||||
"reference": "7b5fe98b28302a8b25693b2298bca74463336975",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/41fea1e84ed84d373f5ac099a1276c4358c90708",
|
||||
"reference": "41fea1e84ed84d373f5ac099a1276c4358c90708",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -951,7 +951,7 @@
|
||||
"ext-spl": "*",
|
||||
"php": ">=5.3.3",
|
||||
"phpspec/prophecy": "~1.3,>=1.3.1",
|
||||
"phpunit/php-code-coverage": "~2.0,>=2.0.11",
|
||||
"phpunit/php-code-coverage": "~2.1",
|
||||
"phpunit/php-file-iterator": "~1.4",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-timer": "~1.0",
|
||||
@@ -973,7 +973,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.6.x-dev"
|
||||
"dev-master": "4.7.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -999,20 +999,20 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-06-03 05:03:30"
|
||||
"time": "2015-06-11 16:20:25"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "2.3.3",
|
||||
"version": "2.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7"
|
||||
"reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/253c005852591fd547fc18cd5b7b43a1ec82d8f7",
|
||||
"reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35",
|
||||
"reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1054,7 +1054,7 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-05-29 05:19:18"
|
||||
"time": "2015-06-11 15:55:48"
|
||||
},
|
||||
{
|
||||
"name": "pimple/pimple",
|
||||
@@ -1475,16 +1475,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v2.7.0",
|
||||
"version": "v2.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Yaml.git",
|
||||
"reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3"
|
||||
"reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3",
|
||||
"reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3",
|
||||
"url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160",
|
||||
"reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1520,7 +1520,7 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-05-02 15:21:08"
|
||||
"time": "2015-06-10 15:30:22"
|
||||
},
|
||||
{
|
||||
"name": "zeptech/annotations",
|
||||
|
||||
@@ -34,7 +34,7 @@ class GuzzleAdapter extends AdapterAbstract implements QueryableInterface
|
||||
"body" => json_encode($message)
|
||||
];
|
||||
|
||||
$endpoint = $this->getOptions()->getHttpSeriesEndpoint();
|
||||
$endpoint = $this->getHttpSeriesEndpoint();
|
||||
return $this->httpClient->post($endpoint, $httpMessage);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,29 @@ class GuzzleAdapter extends AdapterAbstract implements QueryableInterface
|
||||
|
||||
private function get(array $httpMessage)
|
||||
{
|
||||
$endpoint = $this->getOptions()->getHttpQueryEndpoint();
|
||||
$endpoint = $this->getHttpQueryEndpoint();
|
||||
return $this->httpClient->get($endpoint, $httpMessage)->json();
|
||||
}
|
||||
|
||||
protected function getHttpSeriesEndpoint()
|
||||
{
|
||||
return sprintf(
|
||||
"%s://%s:%d/write",
|
||||
$this->getOptions()->getProtocol(),
|
||||
$this->getOptions()->getHost(),
|
||||
$this->getOptions()->getPort()
|
||||
);
|
||||
}
|
||||
|
||||
protected function getHttpQueryEndpoint($name = false)
|
||||
{
|
||||
$url = sprintf(
|
||||
"%s://%s:%d/query",
|
||||
$this->getOptions()->getProtocol(),
|
||||
$this->getOptions()->getHost(),
|
||||
$this->getOptions()->getPort()
|
||||
);
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
namespace InfluxDB\Adapter;
|
||||
|
||||
use DateTime;
|
||||
use InfluxDB\Options;
|
||||
|
||||
final class UdpAdapter extends AdapterAbstract
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace InfluxDB;
|
||||
|
||||
use InfluxDb\Adapter\QueryableInterface;
|
||||
use InfluxDB\Filter\FilterInterface;
|
||||
|
||||
/**
|
||||
* Client to manage request at InfluxDB
|
||||
@@ -70,18 +69,4 @@ class Client
|
||||
}
|
||||
return $this->getAdapter()->query("drop database \"{$name}\"");
|
||||
}
|
||||
|
||||
private function clearTimePrecision($timePrecision)
|
||||
{
|
||||
switch ($timePrecision) {
|
||||
case 's':
|
||||
case 'u':
|
||||
case 'ms':
|
||||
break;
|
||||
default:
|
||||
$timePrecision = false;
|
||||
}
|
||||
|
||||
return $timePrecision;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,26 +125,4 @@ class Options
|
||||
$this->database = $database;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHttpSeriesEndpoint()
|
||||
{
|
||||
return sprintf(
|
||||
"%s://%s:%d/write",
|
||||
$this->getProtocol(),
|
||||
$this->getHost(),
|
||||
$this->getPort()
|
||||
);
|
||||
}
|
||||
|
||||
public function getHttpQueryEndpoint($name = false)
|
||||
{
|
||||
$url = sprintf(
|
||||
"%s://%s:%d/query",
|
||||
$this->getProtocol(),
|
||||
$this->getHost(),
|
||||
$this->getPort()
|
||||
);
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user