@@ -86,10 +86,10 @@ |
||
86 | 86 | |
87 | 87 | if (isset($response['contacts']['add'])) { |
88 | 88 | $result = array_map(function($item) { |
89 | - if(!empty($item['id'])) |
|
89 | + if (!empty($item['id'])) |
|
90 | 90 | return $item['id']; |
91 | - elseif(!empty($item['error'])) |
|
92 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
91 | + elseif (!empty($item['error'])) |
|
92 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
93 | 93 | else |
94 | 94 | return []; |
95 | 95 | }, $response['contacts']['add']); |
@@ -112,10 +112,10 @@ |
||
112 | 112 | |
113 | 113 | if (isset($response['tasks']['add'])) { |
114 | 114 | $result = array_map(function($item) { |
115 | - if(!empty($item['id'])) |
|
115 | + if (!empty($item['id'])) |
|
116 | 116 | return $item['id']; |
117 | - elseif(!empty($item['error'])) |
|
118 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
117 | + elseif (!empty($item['error'])) |
|
118 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
119 | 119 | else |
120 | 120 | return []; |
121 | 121 | }, $response['tasks']['add']); |
@@ -80,11 +80,11 @@ |
||
80 | 80 | $response = $this->postRequest('/private/api/v2/json/customers/set', $parameters); |
81 | 81 | |
82 | 82 | if (isset($response['customers']['add'])) { |
83 | - $result = array_map(function ($item) { |
|
84 | - if(!empty($item['id'])) |
|
83 | + $result = array_map(function($item) { |
|
84 | + if (!empty($item['id'])) |
|
85 | 85 | return $item['id']; |
86 | - elseif(!empty($item['error'])) |
|
87 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
86 | + elseif (!empty($item['error'])) |
|
87 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
88 | 88 | else |
89 | 89 | return []; |
90 | 90 | }, $response['customers']['add']['customers']); |
@@ -75,11 +75,11 @@ |
||
75 | 75 | $response = $this->postRequest('/private/api/v2/json/catalogs/set', $parameters); |
76 | 76 | |
77 | 77 | if (isset($response['catalogs']['add']['catalogs'])) { |
78 | - $result = array_map(function ($item) { |
|
79 | - if(!empty($item['id'])) |
|
78 | + $result = array_map(function($item) { |
|
79 | + if (!empty($item['id'])) |
|
80 | 80 | return $item['id']; |
81 | - elseif(!empty($item['error'])) |
|
82 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
81 | + elseif (!empty($item['error'])) |
|
82 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
83 | 83 | else |
84 | 84 | return []; |
85 | 85 | }, $response['catalogs']['add']['catalogs']); |
@@ -141,10 +141,10 @@ |
||
141 | 141 | |
142 | 142 | if (isset($response['notes']['add'])) { |
143 | 143 | $result = array_map(function($item) { |
144 | - if(!empty($item['id'])) |
|
144 | + if (!empty($item['id'])) |
|
145 | 145 | return $item['id']; |
146 | - elseif(!empty($item['error'])) |
|
147 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
146 | + elseif (!empty($item['error'])) |
|
147 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
148 | 148 | else |
149 | 149 | return []; |
150 | 150 | }, $response['notes']['add']); |
@@ -79,11 +79,11 @@ |
||
79 | 79 | $response = $this->postRequest('/private/api/v2/json/transactions/set', $parameters); |
80 | 80 | |
81 | 81 | if (isset($response['transactions']['add']['transactions'])) { |
82 | - $result = array_map(function ($item) { |
|
83 | - if(!empty($item['id'])) |
|
82 | + $result = array_map(function($item) { |
|
83 | + if (!empty($item['id'])) |
|
84 | 84 | return $item['id']; |
85 | - elseif(!empty($item['error'])) |
|
86 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
85 | + elseif (!empty($item['error'])) |
|
86 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
87 | 87 | else |
88 | 88 | return []; |
89 | 89 | }, $response['transactions']['add']['transactions']); |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | $response = $this->postRequest('/private/api/v2/json/catalog_elements/set', $parameters); |
72 | 72 | |
73 | 73 | if (isset($response['catalog_elements']['add']['catalog_elements'])) { |
74 | - $result = array_map(function ($item) { |
|
75 | - if(!empty($item['id'])) |
|
74 | + $result = array_map(function($item) { |
|
75 | + if (!empty($item['id'])) |
|
76 | 76 | return $item['id']; |
77 | - elseif(!empty($item['error'])) |
|
78 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
77 | + elseif (!empty($item['error'])) |
|
78 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
79 | 79 | else |
80 | 80 | return []; |
81 | 81 | }, $response['catalog_elements']['add']['catalog_elements']); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function apiDeleteBatch(array $ids) |
163 | 163 | { |
164 | - array_walk($ids, function($id){ |
|
164 | + array_walk($ids, function($id) { |
|
165 | 165 | $this->checkId($id); |
166 | 166 | }); |
167 | 167 |
@@ -91,10 +91,10 @@ |
||
91 | 91 | |
92 | 92 | if (isset($response['leads']['add'])) { |
93 | 93 | $result = array_map(function($item) { |
94 | - if(!empty($item['id'])) |
|
94 | + if (!empty($item['id'])) |
|
95 | 95 | return $item['id']; |
96 | - elseif(!empty($item['error'])) |
|
97 | - throw new Exception($item['error'],filter_var(mb_strstr($item['error'],".",true), FILTER_SANITIZE_NUMBER_INT)); |
|
96 | + elseif (!empty($item['error'])) |
|
97 | + throw new Exception($item['error'], filter_var(mb_strstr($item['error'], ".", true), FILTER_SANITIZE_NUMBER_INT)); |
|
98 | 98 | else |
99 | 99 | return []; |
100 | 100 | }, $response['leads']['add']); |
@@ -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']); |