Completed
Pull Request — master (#14)
by
unknown
02:08
created
src/AccessTokenGenerator.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
     /**
8 8
      * Create an access token from stored json data
9 9
      *
10
-     * @param $text
10
+     * @param string $text
11 11
      * @return AccessToken
12 12
      */
13 13
     public function createFromJson($text)
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
     /**
93 93
      * @param array $array
94
-     * @param mixed $key
94
+     * @param string $key
95 95
      * @return null
96 96
      */
97 97
     private function getKeyIfSet($array, $key)
Please login to merge, or discard this patch.
src/TokenStore/LocalFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function fetchAccessToken()
46 46
     {
47 47
         try {
48
-            $accessTokenJson = file_get_contents($this->filePath . '/' . $this->fileName);
48
+            $accessTokenJson = file_get_contents($this->filePath.'/'.$this->fileName);
49 49
         } catch (\ErrorException $e) {
50 50
             throw new \Exception('Salesforce access token not found');
51 51
         }
@@ -58,6 +58,6 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function saveAccessToken(AccessToken $accessToken)
60 60
     {
61
-        file_put_contents($this->filePath . '/' . $this->fileName, $accessToken->toJson());
61
+        file_put_contents($this->filePath.'/'.$this->fileName, $accessToken->toJson());
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
src/Client.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         } catch (GuzzleRequestException $e) {
266 266
             
267 267
             if ($e->getResponse() === null) {
268
-        		throw $e;
269
-        	}
268
+          throw $e;
269
+         }
270 270
 
271 271
             //If its an auth error convert to an auth exception
272 272
             if ($e->getResponse()->getStatusCode() == 401) {
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
     private function getAuthHeader()
285 285
     {
286 286
         if ($this->accessToken === null) {
287
-    		throw new AuthenticationException(0, "Access token not set");
288
-    	}
287
+      throw new AuthenticationException(0, "Access token not set");
288
+     }
289 289
     	
290 290
         return 'Bearer ' . $this->accessToken->getAccessToken();
291 291
     }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function getRecord($objectType, $sfId, array $fields)
78 78
     {
79
-        $url      = $this->baseUrl . '/services/data/v20.0/sobjects/' . $objectType . '/' . $sfId . '?fields=' . implode(',', $fields);
79
+        $url      = $this->baseUrl.'/services/data/v20.0/sobjects/'.$objectType.'/'.$sfId.'?fields='.implode(',', $fields);
80 80
         $response = $this->makeRequest('get', $url, ['headers' => ['Authorization' => $this->getAuthHeader()]]);
81 81
 
82 82
         return json_decode($response->getBody(), true);
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
     public function search($query = null, $next_url = null)
95 95
     {
96 96
         if ( ! empty($next_url)) {
97
-            $url = $this->baseUrl . '/' . $next_url;
97
+            $url = $this->baseUrl.'/'.$next_url;
98 98
         } else {
99
-            $url = $this->baseUrl . '/services/data/v24.0/query/?q=' . urlencode($query);
99
+            $url = $this->baseUrl.'/services/data/v24.0/query/?q='.urlencode($query);
100 100
         }
101 101
         $response = $this->makeRequest('get', $url, ['headers' => ['Authorization' => $this->getAuthHeader()]]);
102 102
         $data     = json_decode($response->getBody(), true);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function updateRecord($object, $id, array $data)
125 125
     {
126
-        $url = $this->baseUrl . '/services/data/v20.0/sobjects/' . $object . '/' . $id;
126
+        $url = $this->baseUrl.'/services/data/v20.0/sobjects/'.$object.'/'.$id;
127 127
 
128 128
         $this->makeRequest('patch', $url, [
129 129
             'headers' => ['Content-Type' => 'application/json', 'Authorization' => $this->getAuthHeader()],
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function createRecord($object, $data)
145 145
     {
146
-        $url = $this->baseUrl . '/services/data/v20.0/sobjects/' . $object . '/';
146
+        $url = $this->baseUrl.'/services/data/v20.0/sobjects/'.$object.'/';
147 147
 
148
-        $response     = $this->makeRequest('post', $url, [
148
+        $response = $this->makeRequest('post', $url, [
149 149
             'headers' => ['Content-Type' => 'application/json', 'Authorization' => $this->getAuthHeader()],
150 150
             'body'    => json_encode($data)
151 151
         ]);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function deleteRecord($object, $id)
166 166
     {
167
-        $url = $this->baseUrl . '/services/data/v20.0/sobjects/' . $object . '/' . $id;
167
+        $url = $this->baseUrl.'/services/data/v20.0/sobjects/'.$object.'/'.$id;
168 168
 
169 169
         $this->makeRequest('delete', $url, ['headers' => ['Authorization' => $this->getAuthHeader()]]);
170 170
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function bulkDeleteRecords(array $ids)
185 185
     {
186
-        $url = $this->baseUrl . '/services/data/v20.0/composite/sobjects?ids=' . \implode($ids, ',');
186
+        $url = $this->baseUrl.'/services/data/v20.0/composite/sobjects?ids='.\implode($ids, ',');
187 187
 
188 188
         $this->makeRequest('delete', $url, ['headers' => ['Authorization' => $this->getAuthHeader()]]);
189 189
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function login($username, $password)
202 202
     {
203
-        $url = $this->salesforceLoginUrl . 'services/oauth2/token';
203
+        $url = $this->salesforceLoginUrl.'services/oauth2/token';
204 204
 
205 205
         $post_data = [
206 206
             'grant_type'    => 'password',
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function authorizeConfirm($code, $redirect_url)
227 227
     {
228
-        $url = $this->salesforceLoginUrl . 'services/oauth2/token';
228
+        $url = $this->salesforceLoginUrl.'services/oauth2/token';
229 229
 
230 230
         $post_data = [
231 231
             'grant_type'    => 'authorization_code',
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             'grant_type'    => 'authorization_code'
256 256
         ];
257 257
 
258
-        return $this->salesforceLoginUrl . 'services/oauth2/authorize?' . http_build_query($params);
258
+        return $this->salesforceLoginUrl.'services/oauth2/authorize?'.http_build_query($params);
259 259
     }
260 260
 
261 261
     /**
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      */
267 267
     public function refreshToken()
268 268
     {
269
-        $url = $this->salesforceLoginUrl . 'services/oauth2/token';
269
+        $url = $this->salesforceLoginUrl.'services/oauth2/token';
270 270
 
271 271
         $post_data = [
272 272
             'grant_type'    => 'refresh_token',
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
     		throw new AuthenticationException(0, "Access token not set");
332 332
     	}
333 333
     	
334
-        return 'Bearer ' . $this->accessToken->getAccessToken();
334
+        return 'Bearer '.$this->accessToken->getAccessToken();
335 335
     }
336 336
 
337 337
 }
Please login to merge, or discard this patch.