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 ($ awsConfigarray_get ($ this getElasticConfig ('aws ' ), 'iam ' , false )) {
28+             if  (! empty ($ awsConfigarray_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+         $ keyarray_get ($ awsConfig'key ' );
5552        $ secretarray_get ($ awsConfig'secret ' );
5653        $ regionarray_get ($ awsConfig'region ' , 'us-west-2 ' );
5754
5855        $ psr7Handler\Aws \default_http_handler ();
59-         $ signer      = new  SignatureV4 ('es ' , $ region
56+         $ signernew  SignatureV4 ('es ' , $ region
6057
6158        $ handlerfunction  (array  $ requestuse  (
6259            $ psr7Handler
@@ -87,11 +84,10 @@ private function getAwsESHandler()
8784                'headers '         => $ responsegetHeaders (),
8885                'body '            => $ responsegetBody ()->detach (),
8986                'transfer_stats '  => ['total_time '  => 0 ],
90-                 'effective_url '   => (string )$ psr7RequestgetUri (),
87+                 'effective_url '   => (string )  $ psr7RequestgetUri (),
9188            ]);
9289        };
9390
9491        return  $ handler
9592    }
96- 
9793}
0 commit comments