@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @param array $config |
| 36 | 36 | * |
| 37 | - * @return \Elasticsearch\Client|mixed |
|
| 37 | + * @return Client |
|
| 38 | 38 | */ |
| 39 | 39 | public function make(array $config) |
| 40 | 40 | { |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | use Elasticsearch\Client; |
| 4 | 4 | use Elasticsearch\ClientBuilder; |
| 5 | 5 | use Illuminate\Support\Arr; |
| 6 | -use Psr\Log\LoggerInterface; |
|
| 7 | -use Monolog\Logger; |
|
| 8 | 6 | use Monolog\Handler\StreamHandler; |
| 7 | +use Monolog\Logger; |
|
| 8 | +use Psr\Log\LoggerInterface; |
|
| 9 | 9 | |
| 10 | 10 | class Factory |
| 11 | 11 | { |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | 'status' => $response->getStatusCode(), |
| 158 | 158 | 'headers' => $response->getHeaders(), |
| 159 | 159 | 'body' => $response->getBody() |
| 160 | - ->detach(), |
|
| 160 | + ->detach(), |
|
| 161 | 161 | 'transfer_stats' => [ |
| 162 | 162 | 'total_time' => $http_stats->data["total_time"] ?? 0, |
| 163 | 163 | "primary_port" => $http_stats->data["primary_port"] ?? '' |
@@ -137,14 +137,14 @@ discard block |
||
| 137 | 137 | // Get curl stats |
| 138 | 138 | $http_stats = new class { |
| 139 | 139 | public $data = []; |
| 140 | - public function __invoke(...$args){ |
|
| 140 | + public function __invoke(...$args) { |
|
| 141 | 141 | $this->data = $args[0]; |
| 142 | 142 | } |
| 143 | 143 | }; |
| 144 | 144 | |
| 145 | 145 | // Send the signed request to Amazon ES |
| 146 | 146 | /** @var \Psr\Http\Message\ResponseInterface $response */ |
| 147 | - $response = $psr7Handler($signedRequest,['http_stats_receiver' => $http_stats]) |
|
| 147 | + $response = $psr7Handler($signedRequest, ['http_stats_receiver' => $http_stats]) |
|
| 148 | 148 | ->then(function(\Psr\Http\Message\ResponseInterface $response) { |
| 149 | 149 | return $response; |
| 150 | 150 | }, function($error) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'total_time' => $http_stats->data["total_time"] ?? 0, |
| 163 | 163 | "primary_port" => $http_stats->data["primary_port"] ?? '' |
| 164 | 164 | ], |
| 165 | - 'effective_url' => (string)$psr7Request->getUri(), |
|
| 165 | + 'effective_url' => (string) $psr7Request->getUri(), |
|
| 166 | 166 | ]); |
| 167 | 167 | }); |
| 168 | 168 | } |
@@ -135,9 +135,11 @@ |
||
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | // Get curl stats |
| 138 | - $http_stats = new class { |
|
| 138 | + $http_stats = new class |
|
| 139 | + { |
|
| 139 | 140 | public $data = []; |
| 140 | - public function __invoke(...$args){ |
|
| 141 | + public function __invoke(...$args) |
|
| 142 | + { |
|
| 141 | 143 | $this->data = $args[0]; |
| 142 | 144 | } |
| 143 | 145 | }; |