Completed
Push — master ( 51b3c9...7e0a4b )
by Colin
01:52
created
src/Factory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
             }
79 79
         }
80 80
 
81
-        foreach($config['hosts'] as $c) {
82
-            if( $c['aws'] ) {
83
-                $clientBuilder->setHandler( function(array $request) use($c) {
81
+        foreach ($config['hosts'] as $c) {
82
+            if ($c['aws']) {
83
+                $clientBuilder->setHandler(function(array $request) use($c) {
84 84
                     $psr7Handler = \Aws\default_http_handler();
85 85
                     $signer = new \Aws\Signature\SignatureV4('es', $c['aws_region']);
86 86
                     $request['headers']['Host'][0] = parse_url($request['headers']['Host'][0])['host'];
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
                     );
101 101
                     // Send the signed request to Amazon ES
102 102
                     /** @var \Psr\Http\Message\ResponseInterface $response */
103
-                    $response = $psr7Handler($signedRequest)->then(function (\Psr\Http\Message\ResponseInterface $response) {
103
+                    $response = $psr7Handler($signedRequest)->then(function(\Psr\Http\Message\ResponseInterface $response) {
104 104
                         return $response;
105
-                    }, function ($error) {
105
+                    }, function($error) {
106 106
                         return $error['response'];
107 107
                     })->wait();
108 108
                     // Convert the PSR-7 response to a RingPHP response
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                         'headers' => $response->getHeaders(),
112 112
                         'body' => $response->getBody()->detach(),
113 113
                         'transfer_stats' => ['total_time' => 0],
114
-                        'effective_url' => (string)$psr7Request->getUri(),
114
+                        'effective_url' => (string) $psr7Request->getUri(),
115 115
                     ]);
116 116
                 });
117 117
             }
Please login to merge, or discard this patch.