@@ -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); |
@@ -57,14 +57,14 @@ |
||
57 | 57 | break; |
58 | 58 | case EnumOutputMode::MODE_ARRAY: |
59 | 59 | $collection = new ArrayCollection(); |
60 | - array_walk($data, function ($item) use ($collection) { |
|
60 | + array_walk($data, function($item) use ($collection) { |
|
61 | 61 | $collection->push($item); |
62 | 62 | }); |
63 | 63 | break; |
64 | 64 | case EnumOutputMode::MODE_ENTITY: |
65 | 65 | default: |
66 | 66 | $collection = new EntityCollection(); |
67 | - array_walk($data, function ($item) use ($collection) { |
|
67 | + array_walk($data, function($item) use ($collection) { |
|
68 | 68 | if (!empty($item)) { |
69 | 69 | $collection->push(ResponseDtoBuilder::make($this->entity, $item)); |
70 | 70 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | protected function exception(\Exception $e) |
65 | 65 | { |
66 | - /* echo json_encode([ |
|
66 | + /* echo json_encode([ |
|
67 | 67 | 'code' => $e->getCode(), |
68 | 68 | 'message' => $e->getMessage() |
69 | 69 | ]); */ |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $entityMethods = get_class_methods($this); |
20 | 20 | $params = []; |
21 | 21 | |
22 | - array_walk($entityMethods, function ($method) use (&$entity, &$params) { |
|
22 | + array_walk($entityMethods, function($method) use (&$entity, &$params) { |
|
23 | 23 | if (substr($method, 0, 3) == 'get') { |
24 | 24 | $entityProperty = lcfirst(substr($method, 3)); |
25 | 25 | if (isset($entity->$entityProperty)) { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $params[$entityProperty] = $ePropertyVal; |
34 | 34 | |
35 | 35 | $propIndex = array_search($entityProperty, $entity->requiredFields, true); |
36 | - if($propIndex > -1 && !empty($params[$entityProperty])) { |
|
36 | + if ($propIndex > -1 && !empty($params[$entityProperty])) { |
|
37 | 37 | unset($entity->requiredFields[$propIndex]); |
38 | 38 | } |
39 | 39 |