@@ -90,12 +90,12 @@ |
||
90 | 90 | |
91 | 91 | if (isset($response['contacts']['add'])) { |
92 | 92 | $result = array_map(function ($item) { |
93 | - if(!empty($item['id'])) |
|
94 | - return $item['id']; |
|
95 | - elseif(!empty($item['error'])) |
|
96 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
97 | - else |
|
98 | - return []; |
|
93 | + if(!empty($item['id'])) |
|
94 | + return $item['id']; |
|
95 | + elseif(!empty($item['error'])) |
|
96 | + throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
97 | + else |
|
98 | + return []; |
|
99 | 99 | }, $response['contacts']['add']); |
100 | 100 | } else { |
101 | 101 | return []; |
@@ -89,11 +89,11 @@ |
||
89 | 89 | $response = $this->postRequest('/private/api/v2/json/contacts/set', $parameters); |
90 | 90 | |
91 | 91 | if (isset($response['contacts']['add'])) { |
92 | - $result = array_map(function ($item) { |
|
93 | - if(!empty($item['id'])) |
|
92 | + $result = array_map(function($item) { |
|
93 | + if (!empty($item['id'])) |
|
94 | 94 | return $item['id']; |
95 | - elseif(!empty($item['error'])) |
|
96 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
95 | + elseif (!empty($item['error'])) |
|
96 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
97 | 97 | else |
98 | 98 | return []; |
99 | 99 | }, $response['contacts']['add']); |
@@ -90,12 +90,13 @@ |
||
90 | 90 | |
91 | 91 | if (isset($response['contacts']['add'])) { |
92 | 92 | $result = array_map(function ($item) { |
93 | - if(!empty($item['id'])) |
|
94 | - return $item['id']; |
|
95 | - elseif(!empty($item['error'])) |
|
96 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
97 | - else |
|
98 | - return []; |
|
93 | + if(!empty($item['id'])) { |
|
94 | + return $item['id']; |
|
95 | + } elseif(!empty($item['error'])) { |
|
96 | + throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
97 | + } else { |
|
98 | + return []; |
|
99 | + } |
|
99 | 100 | }, $response['contacts']['add']); |
100 | 101 | } else { |
101 | 102 | return []; |
@@ -98,12 +98,12 @@ |
||
98 | 98 | |
99 | 99 | if (isset($response['fields']['add'])) { |
100 | 100 | $result = array_map(function ($item) { |
101 | - if(!empty($item['id'])) |
|
102 | - return $item['id']; |
|
103 | - elseif(!empty($item['error'])) |
|
104 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
105 | - else |
|
106 | - return []; |
|
101 | + if(!empty($item['id'])) |
|
102 | + return $item['id']; |
|
103 | + elseif(!empty($item['error'])) |
|
104 | + throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
105 | + else |
|
106 | + return []; |
|
107 | 107 | }, $response['fields']['add']); |
108 | 108 | } else { |
109 | 109 | return []; |
@@ -97,11 +97,11 @@ |
||
97 | 97 | $response = $this->postRequest('/private/api/v2/json/fields/set', $parameters); |
98 | 98 | |
99 | 99 | if (isset($response['fields']['add'])) { |
100 | - $result = array_map(function ($item) { |
|
101 | - if(!empty($item['id'])) |
|
100 | + $result = array_map(function($item) { |
|
101 | + if (!empty($item['id'])) |
|
102 | 102 | return $item['id']; |
103 | - elseif(!empty($item['error'])) |
|
104 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
103 | + elseif (!empty($item['error'])) |
|
104 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
105 | 105 | else |
106 | 106 | return []; |
107 | 107 | }, $response['fields']['add']); |
@@ -98,12 +98,13 @@ |
||
98 | 98 | |
99 | 99 | if (isset($response['fields']['add'])) { |
100 | 100 | $result = array_map(function ($item) { |
101 | - if(!empty($item['id'])) |
|
102 | - return $item['id']; |
|
103 | - elseif(!empty($item['error'])) |
|
104 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
105 | - else |
|
106 | - return []; |
|
101 | + if(!empty($item['id'])) { |
|
102 | + return $item['id']; |
|
103 | + } elseif(!empty($item['error'])) { |
|
104 | + throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
105 | + } else { |
|
106 | + return []; |
|
107 | + } |
|
107 | 108 | }, $response['fields']['add']); |
108 | 109 | } else { |
109 | 110 | return []; |