2
2
3
3
namespace Napp \Salesforce ;
4
4
5
- use function Couchbase \defaultDecoder ;
6
- use Napp \Salesforce \Exceptions \RequestException ;
7
5
use GuzzleHttp \Exception \GuzzleException ;
8
6
use Napp \Salesforce \Exceptions \AuthenticationException ;
7
+ use Napp \Salesforce \Exceptions \RequestException ;
9
8
10
9
class Client
11
10
{
@@ -129,7 +128,7 @@ public function getRecord(string $objectType, string $id, array $fields = []): a
129
128
130
129
return $ this ->makeRequest (
131
130
'get ' ,
132
- $ this ->generateUrl ('sobjects/ ' . $ objectType . '/ ' . $ id . $ fieldsQuery ),
131
+ $ this ->generateUrl ('sobjects/ ' . $ objectType . '/ ' . $ id . $ fieldsQuery ),
133
132
[
134
133
'headers ' => [
135
134
'Authorization ' => $ this ->getAuthHeader ()
@@ -162,7 +161,7 @@ public function search($query = null, $nextUrl = null): array
162
161
163
162
$ nextRecordsUrl = $ data ['nextRecordsUrl ' ] ?? '' ;
164
163
165
- if (! $ done ) {
164
+ if (!$ done ) {
166
165
$ moreResults = $ this ->search (null , substr ($ nextRecordsUrl , 1 ));
167
166
168
167
if ([] !== $ moreResults ) {
@@ -187,7 +186,7 @@ public function search($query = null, $nextUrl = null): array
187
186
*/
188
187
public function updateRecord (string $ type , string $ objectId , array $ data ): bool
189
188
{
190
- $ url = $ this ->generateUrl ('sobjects/ ' . $ type . '/ ' . $ objectId );
189
+ $ url = $ this ->generateUrl ('sobjects/ ' . $ type . '/ ' . $ objectId );
191
190
192
191
$ this ->makeRequest ('patch ' , $ url , [
193
192
'headers ' => [
@@ -211,7 +210,7 @@ public function updateRecord(string $type, string $objectId, array $data): bool
211
210
*/
212
211
public function createRecord (string $ type , array $ data ): string
213
212
{
214
- $ url = $ this ->generateUrl ('sobjects/ ' . $ type );
213
+ $ url = $ this ->generateUrl ('sobjects/ ' . $ type );
215
214
216
215
$ response = $ this ->makeRequest (
217
216
'post ' ,
@@ -239,7 +238,7 @@ public function createRecord(string $type, array $data): string
239
238
*/
240
239
public function deleteRecord (string $ type , string $ objectId ): bool
241
240
{
242
- $ url = $ this ->generateUrl ('sobjects/ ' . $ type . '/ ' . $ objectId );
241
+ $ url = $ this ->generateUrl ('sobjects/ ' . $ type . '/ ' . $ objectId );
243
242
244
243
$ this ->makeRequest ('delete ' , $ url , ['headers ' => ['Authorization ' => $ this ->getAuthHeader ()]]);
245
244
@@ -403,6 +402,6 @@ private function getAuthHeader(): string
403
402
*/
404
403
private function generateUrl (string $ append ): string
405
404
{
406
- return $ this ->baseUrl . '/services/data/ ' . $ this ->clientConfig ->getVersion (). '/ ' . $ append ;
405
+ return $ this ->baseUrl . '/services/data/ ' . $ this ->clientConfig ->getVersion () . '/ ' . $ append ;
407
406
}
408
407
}
0 commit comments