@@ -207,12 +207,16 @@ discard block |
||
207 | 207 | |
208 | 208 | /** |
209 | 209 | * @param $object: JSON object |
210 | + * @param \SimpleXMLElement $object |
|
210 | 211 | */ |
211 | 212 | public static function object2array($object) |
212 | 213 | { |
213 | 214 | return @json_decode(@json_encode($object), 1); |
214 | 215 | } |
215 | 216 | |
217 | + /** |
|
218 | + * @param string $url |
|
219 | + */ |
|
216 | 220 | public static function makeUrlRequst($url, $options) { |
217 | 221 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
218 | 222 | $query = isset($options['query']) ? |
@@ -377,6 +381,7 @@ discard block |
||
377 | 381 | * Returns an array of the object properties |
378 | 382 | * @param $object: An object. |
379 | 383 | * @param $exclude: array of the object parameters to be excluded from the returned array. |
384 | + * @param string[] $exclude |
|
380 | 385 | */ |
381 | 386 | public static function getObjectProperties($object, $exclude) |
382 | 387 | { |
@@ -397,6 +402,7 @@ discard block |
||
397 | 402 | * Returns url path generated from the array of the fields and parameters. |
398 | 403 | * @param $allFields; array of the paossible fields (parameter names). |
399 | 404 | * @param $params: input parameters (array or object). |
405 | + * @param string[] $allFields |
|
400 | 406 | */ |
401 | 407 | public static function generateUrlPath($allFields, $params) |
402 | 408 | { |
@@ -327,8 +327,7 @@ |
||
327 | 327 | $orderResults = $order->addOrder($orderParameters); |
328 | 328 | |
329 | 329 | array_push($results['success'], "The order with order_id = ".strval($orderResults["order_id"])." added successfuly."); |
330 | - } |
|
331 | - else { |
|
330 | + } else { |
|
332 | 331 | array_push($results['fail'], "$iRow --> one of the parameters cached_lat, cached_lng, address_1 is not set"); |
333 | 332 | } |
334 | 333 |
@@ -98,9 +98,15 @@ |
||
98 | 98 | |
99 | 99 | $vehicles = $this->getVehicles($params); |
100 | 100 | |
101 | - if (is_null($vehicles)) return null; |
|
102 | - if (!isset($vehicles['data'])) return null; |
|
103 | - if (sizeof($vehicles['data'])<1) return null; |
|
101 | + if (is_null($vehicles)) { |
|
102 | + return null; |
|
103 | + } |
|
104 | + if (!isset($vehicles['data'])) { |
|
105 | + return null; |
|
106 | + } |
|
107 | + if (sizeof($vehicles['data'])<1) { |
|
108 | + return null; |
|
109 | + } |
|
104 | 110 | |
105 | 111 | $randomIndex = rand(0, sizeof($vehicles['data'])-1); |
106 | 112 |