Passed
Push — master ( 5ea928...3b607e )
by Stanley
10:58 queued 06:33
created
src/MpesaApiClient.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $mode = config('laravel-daraja.mode');
73 73
 
74 74
         $options = [
75
-            'base_uri' => $this->base_url[$mode],
75
+            'base_uri' => $this->base_url[ $mode ],
76 76
             'verify' => $mode === 'sandbox' ? false : true,
77 77
         ];
78 78
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     protected function securityCredential($plaintext)
143 143
     {
144
-        $publicKey = file_get_contents(__DIR__.'/../cert.cer');
144
+        $publicKey = file_get_contents(__DIR__ . '/../cert.cer');
145 145
 
146 146
         openssl_public_encrypt($plaintext, $encrypted, $publicKey, OPENSSL_PKCS1_PADDING);
147 147
 
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
      *
159 159
      * @throws MpesaApiRequestException
160 160
      */
161
-    protected function call($url, $options = [], $method = 'POST')
161
+    protected function call($url, $options = [ ], $method = 'POST')
162 162
     {
163 163
         if (isset($this->accessToken)) {
164
-            $options['headers'] = ['Authorization' => 'Bearer '.$this->accessToken];
164
+            $options[ 'headers' ] = [ 'Authorization' => 'Bearer ' . $this->accessToken ];
165 165
         }
166 166
 
167 167
         try {
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         } catch (ServerException $e) {
176 176
             $response = json_decode($e->getResponse()->getBody()->getContents());
177 177
             if (isset($response->Envelope)) {
178
-                $message = 'Safaricom APIs: '.$response->Envelope->Body->Fault->faultstring;
178
+                $message = 'Safaricom APIs: ' . $response->Envelope->Body->Fault->faultstring;
179 179
                 throw new MpesaApiRequestException($message, $e->getCode());
180 180
             }
181
-            throw new MpesaApiRequestException('Safaricom APIs: '.$response->errorMessage, $e->getCode());
181
+            throw new MpesaApiRequestException('Safaricom APIs: ' . $response->errorMessage, $e->getCode());
182 182
         } catch (ClientException $e) {
183 183
             $response = json_decode($e->getResponse()->getBody()->getContents());
184 184
             throw new MpesaApiRequestException('Safaricom APIs: '
Please login to merge, or discard this patch.