1111
1212trait ElasticquentClientTrait
1313{
14-
1514 use ElasticquentConfigTrait;
1615
17-
1816 /**
19- * Get ElasticSearch Client
17+ * Get ElasticSearch Client.
2018 *
2119 * @return \Elasticsearch\Client
2220 */
@@ -27,7 +25,7 @@ public function getElasticSearchClient()
2725 // elasticsearch v2.0 using builder
2826 if (class_exists ('\Elasticsearch\ClientBuilder ' )) {
2927 $ awsConfig = $ this ->getElasticConfig ('aws ' );
30- if ( ! empty ($ awsConfig ) && array_get ($ this ->getElasticConfig ('aws ' ), 'iam ' , false )) {
28+ if (! empty ($ awsConfig ) && array_get ($ this ->getElasticConfig ('aws ' ), 'iam ' , false )) {
3129 if ($ handler = $ this ->getAwsESHandler ()) {
3230 array_set ($ config , 'handler ' , $ handler );
3331 }
@@ -40,7 +38,6 @@ public function getElasticSearchClient()
4038 return new \Elasticsearch \Client ($ config );
4139 }
4240
43-
4441 /**
4542 * @return bool|\Closure
4643 */
@@ -51,12 +48,12 @@ private function getAwsESHandler()
5148 return false ;
5249 }
5350
54- $ key = array_get ($ awsConfig , 'key ' );
51+ $ key = array_get ($ awsConfig , 'key ' );
5552 $ secret = array_get ($ awsConfig , 'secret ' );
5653 $ region = array_get ($ awsConfig , 'region ' , 'us-west-2 ' );
5754
5855 $ psr7Handler = \Aws \default_http_handler ();
59- $ signer = new SignatureV4 ('es ' , $ region );
56+ $ signer = new SignatureV4 ('es ' , $ region );
6057
6158 $ handler = function (array $ request ) use (
6259 $ psr7Handler ,
@@ -87,11 +84,10 @@ private function getAwsESHandler()
8784 'headers ' => $ response ->getHeaders (),
8885 'body ' => $ response ->getBody ()->detach (),
8986 'transfer_stats ' => ['total_time ' => 0 ],
90- 'effective_url ' => (string )$ psr7Request ->getUri (),
87+ 'effective_url ' => (string ) $ psr7Request ->getUri (),
9188 ]);
9289 };
9390
9491 return $ handler ;
9592 }
96-
9793}
0 commit comments