@@ -219,14 +219,14 @@ |
||
219 | 219 | break; |
220 | 220 | case EnumOutputMode::MODE_ARRAY: |
221 | 221 | $collection = new ArrayCollection(); |
222 | - array_walk($this->bodyApiResult[$this->entity::$rootDataKey], function ($item) use ($collection) { |
|
222 | + array_walk($this->bodyApiResult[$this->entity::$rootDataKey], function($item) use ($collection) { |
|
223 | 223 | $collection->push($item); |
224 | 224 | }); |
225 | 225 | break; |
226 | 226 | case EnumOutputMode::MODE_ENTITY: |
227 | 227 | default: |
228 | 228 | $collection = new EntityCollection(); |
229 | - array_walk($data[$this->entity::$rootDataKey], function ($item) use ($collection) { |
|
229 | + array_walk($data[$this->entity::$rootDataKey], function($item) use ($collection) { |
|
230 | 230 | $collection->push(ResponseBuilder::make($this->entity, $item)); |
231 | 231 | }); |
232 | 232 | break; |
@@ -16,13 +16,13 @@ |
||
16 | 16 | $bodyParams = $this->buildRequestParams($params); |
17 | 17 | |
18 | 18 | $this->addCurlOpt(CURLOPT_URL, static::$host . $endpoint) |
19 | - ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::POST) |
|
20 | - ->addCurlOpt(CURLOPT_ENCODING, '') |
|
21 | - ->addCurlOpt(CURLOPT_MAXREDIRS, 10) |
|
22 | - ->addCurlOpt(CURLOPT_TIMEOUT, 0) |
|
23 | - ->addCurlOpt(CURLOPT_FOLLOWLOCATION, true) |
|
24 | - ->addCurlOpt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) |
|
25 | - ->addCurlOpt(CURLOPT_POSTFIELDS, $bodyParams); |
|
19 | + ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::POST) |
|
20 | + ->addCurlOpt(CURLOPT_ENCODING, '') |
|
21 | + ->addCurlOpt(CURLOPT_MAXREDIRS, 10) |
|
22 | + ->addCurlOpt(CURLOPT_TIMEOUT, 0) |
|
23 | + ->addCurlOpt(CURLOPT_FOLLOWLOCATION, true) |
|
24 | + ->addCurlOpt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) |
|
25 | + ->addCurlOpt(CURLOPT_POSTFIELDS, $bodyParams); |
|
26 | 26 | |
27 | 27 | if ($this->isNeedAuthorization) { |
28 | 28 | $this->auth($bodyParams); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $queryString = $this->buildRequestParams($queryParams); |
19 | 19 | |
20 | 20 | $this->addCurlOpt(CURLOPT_URL, static::$host . $endpoint . '?' . $queryString) |
21 | - ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::GET); |
|
21 | + ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::GET); |
|
22 | 22 | |
23 | 23 | if ($this->isNeedAuthorization) { |
24 | 24 | $this->auth($queryString); |
@@ -18,14 +18,14 @@ |
||
18 | 18 | $entityMethods = get_class_methods($this); |
19 | 19 | $params = []; |
20 | 20 | |
21 | - array_walk($entityMethods, function ($method) use (&$entity, &$params) { |
|
21 | + array_walk($entityMethods, function($method) use (&$entity, &$params) { |
|
22 | 22 | if (substr($method, 0, 3) == 'get') { |
23 | 23 | $entityProperty = lcfirst(substr($method, 3)); |
24 | 24 | if (isset($entity->$entityProperty)) { |
25 | 25 | $params[$entityProperty] = (string)$entity->$method(); |
26 | 26 | |
27 | 27 | $propIndex = array_search($entityProperty, $entity->requiredFields, true); |
28 | - if($propIndex > -1 && !empty($params[$entityProperty])) { |
|
28 | + if ($propIndex > -1 && !empty($params[$entityProperty])) { |
|
29 | 29 | unset($entity->requiredFields[$propIndex]); |
30 | 30 | } |
31 | 31 |