Completed
Push — master ( 8c6699...bb7b9f )
by Stanley
03:14 queued 16s
created
src/MpesaApiClient.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $mode = config('laravel-daraja.mode');
62 62
 
63 63
         $options = [
64
-            'base_uri' => config('laravel-daraja.base_url.'.$mode),
64
+            'base_uri' => config('laravel-daraja.base_url.' . $mode),
65 65
             'verify' => $mode === 'sandbox' ? false : true,
66 66
         ];
67 67
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     protected function securityCredential($plaintext)
127 127
     {
128
-        $publicKey = file_get_contents(__DIR__.'/../cert.cer');
128
+        $publicKey = file_get_contents(__DIR__ . '/../cert.cer');
129 129
 
130 130
         openssl_public_encrypt($plaintext, $encrypted, $publicKey, OPENSSL_PKCS1_PADDING);
131 131
 
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
      * @return mixed
142 142
      * @throws MpesaApiRequestException
143 143
      */
144
-    protected function call($url, $options = [], $method = 'POST')
144
+    protected function call($url, $options = [ ], $method = 'POST')
145 145
     {
146 146
         if (isset($this->accessToken)) {
147
-            $options['headers'] = ['Authorization' => 'Bearer '.$this->accessToken];
147
+            $options[ 'headers' ] = [ 'Authorization' => 'Bearer ' . $this->accessToken ];
148 148
         }
149 149
 
150 150
         try {
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
         } catch (ServerException $e) {
155 155
             $response = json_decode($e->getResponse()->getBody()->getContents());
156 156
             if (isset($response->Envelope)) {
157
-                $message = 'Safaricom APIs: '.$response->Envelope->Body->Fault->faultstring;
157
+                $message = 'Safaricom APIs: ' . $response->Envelope->Body->Fault->faultstring;
158 158
                 throw new MpesaApiRequestException($message, $e->getCode());
159 159
             }
160
-            throw new MpesaApiRequestException('Safaricom APIs: '.$response->errorMessage, $e->getCode());
160
+            throw new MpesaApiRequestException('Safaricom APIs: ' . $response->errorMessage, $e->getCode());
161 161
         } catch (ClientException $e) {
162 162
             $response = json_decode($e->getResponse()->getBody()->getContents());
163 163
             throw new MpesaApiRequestException('Safaricom APIs: '
Please login to merge, or discard this patch.