Skip to content

Commit

Permalink
Remote typehints for sniff and parseClusterState
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvdm committed Jun 14, 2019
1 parent fe8c236 commit 1de4044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function sniffConnection(Connection $connection): bool
return true;
}

private function parseClusterState(string $transportSchema, array $nodeInfo): array
private function parseClusterState(string $transportSchema, $nodeInfo): array
{
$pattern = '/([^:]*):([0-9]+)/';
$schemaAddress = $transportSchema . '_address';
Expand Down
9 changes: 5 additions & 4 deletions src/Elasticsearch/Connections/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ public function ping(): bool
}
}

public function sniff(): array
/**
* @return array|\GuzzleHttp\Ring\Future\FutureArray
*/
public function sniff()
{
$options = [
'client' => [
Expand All @@ -457,9 +460,7 @@ public function sniff(): array
]
];

$future = $this->performRequest('GET', '/_nodes/', null, null, $options);

return $future->wait();
return $this->performRequest('GET', '/_nodes/', null, null, $options);
}

public function isAlive(): bool
Expand Down

0 comments on commit 1de4044

Please sign in to comment.