@@ -7,7 +7,7 @@ discard block |
||
| 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 |
||
| 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) |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | } catch (GuzzleRequestException $e) { |
| 286 | 286 | |
| 287 | 287 | if ($e->getResponse() === null) { |
| 288 | - throw $e; |
|
| 289 | - } |
|
| 288 | + throw $e; |
|
| 289 | + } |
|
| 290 | 290 | |
| 291 | 291 | //If its an auth error convert to an auth exception |
| 292 | 292 | if ($e->getResponse()->getStatusCode() == 401) { |
@@ -304,8 +304,8 @@ discard block |
||
| 304 | 304 | private function getAuthHeader() |
| 305 | 305 | { |
| 306 | 306 | if ($this->accessToken === null) { |
| 307 | - throw new AuthenticationException(0, "Access token not set"); |
|
| 308 | - } |
|
| 307 | + throw new AuthenticationException(0, "Access token not set"); |
|
| 308 | + } |
|
| 309 | 309 | |
| 310 | 310 | return 'Bearer ' . $this->accessToken->getAccessToken(); |
| 311 | 311 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function getRecord($objectType, $sfId, array $fields) |
| 83 | 83 | { |
| 84 | - $url = $this->baseUrl . "/services/data/v{$this->version}/sobjects/{$objectType}/{$sfId}?fields=".implode(',', $fields); |
|
| 84 | + $url = $this->baseUrl . "/services/data/v{$this->version}/sobjects/{$objectType}/{$sfId}?fields=" . implode(',', $fields); |
|
| 85 | 85 | $response = $this->makeRequest('get', $url, ['headers' => ['Authorization' => $this->getAuthHeader()]]); |
| 86 | 86 | |
| 87 | 87 | return json_decode($response->getBody(), true); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $url = $this->baseUrl . "/services/data/v{$this->version}/sobjects/{$object}/"; |
| 167 | 167 | |
| 168 | - $response = $this->makeRequest('post', $url, [ |
|
| 168 | + $response = $this->makeRequest('post', $url, [ |
|
| 169 | 169 | 'headers' => ['Content-Type' => 'application/json', 'Authorization' => $this->getAuthHeader()], |
| 170 | 170 | 'body' => json_encode($data) |
| 171 | 171 | ]); |