@@ -16,29 +16,24 @@ public function addContact(string $siteKey, array $data)
16
16
return $ this ->post ($ siteKey , 'import/contact ' , $ data );
17
17
}
18
18
19
- private function post (string $ siteKey , string $ request , array $ data, array $ query = [] )
19
+ private function post (string $ siteKey , string $ request , array $ data )
20
20
{
21
- return $ this ->send ($ siteKey , $ request , $ data , 'post ' , $ query );
21
+ return $ this ->send ($ siteKey , $ request , $ data , 'post ' );
22
22
}
23
23
24
- private function send (string $ siteKey , string $ request , $ data , $ method , array $ query )
24
+ private function send (string $ siteKey , string $ request , array $ data , string $ method )
25
25
{
26
26
27
27
$ urlRequest = $ this ->serverUrl . '/ ' . $ request ;
28
28
29
29
$ ch = curl_init ();
30
30
curl_setopt ($ ch , CURLOPT_URL , $ urlRequest );
31
31
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
32
-
33
- if (!is_null ($ method )) {
34
- curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , strtoupper ($ method ));
35
- }
32
+ curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , strtoupper ($ method ));
36
33
37
34
$ json_options = 0 | (PHP_VERSION_ID >= 70300 ? JSON_THROW_ON_ERROR : 0 );
38
35
39
- if (is_array ($ data )) {
40
- curl_setopt ($ ch , CURLOPT_POSTFIELDS , json_encode ($ data , $ json_options ));
41
- }
36
+ curl_setopt ($ ch , CURLOPT_POSTFIELDS , json_encode ($ data , $ json_options ));
42
37
43
38
curl_setopt (
44
39
$ ch ,
0 commit comments