Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #37

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LibreNMS/Data/Source/Fping.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function ping($host, $address_family = 'ipv4'): FpingResponse
return $response;
}

public function bulkPing(array $hosts, Callable $callback): void
public function bulkPing(array $hosts, callable $callback): void
{
$process = app()->make(Process::class, ['command' => [
$this->fping_bin,
Expand Down
3 changes: 2 additions & 1 deletion LibreNMS/Data/Store/TimeSeriesPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class TimeSeriesPoint
public function __construct(
public readonly int $timestamp,
public readonly array $data,
) {}
) {
}

public function ds(): array
{
Expand Down
9 changes: 4 additions & 5 deletions tests/FpingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ private function mockFpingProcess($output, $exitCode)
public function testBulkPing()
{
$expected = [
'192.168.1.4' => [3,3,0,0.62,0.93,0.71,0,0],
'hostname' => [3,0,100,0.0,0.0,0.0,0,1],
'invalid:characters!' => [0,0,0,0.0,0.0,0.0,0,2],
'1.1.1.1' => [3,2,33,0.024,0.054,0.037,0,0],
'192.168.1.4' => [3, 3, 0, 0.62, 0.93, 0.71, 0, 0],
'hostname' => [3, 0, 100, 0.0, 0.0, 0.0, 0, 1],
'invalid:characters!' => [0, 0, 0, 0.0, 0.0, 0.0, 0, 2],
'1.1.1.1' => [3, 2, 33, 0.024, 0.054, 0.037, 0, 0],
];
$hosts = array_keys($expected);

Expand All @@ -165,7 +165,6 @@ public function testBulkPing()
return $process;
});


// make call
$calls = 0;
app()->make(Fping::class)->bulkPing($hosts, function (FpingResponse $response) use ($expected, &$calls) {
Expand Down