@@ -25,7 +25,7 @@ |
||
25 | 25 | return $json; |
26 | 26 | } |
27 | 27 | |
28 | - public static function getUserLocations($query=null) |
|
28 | + public static function getUserLocations($query = null) |
|
29 | 29 | { |
30 | 30 | $json = Route4Me\Route4Me::makeRequst([ |
31 | 31 | 'url' => Endpoint::USER_LOCATION, |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public static function makeRequst($options) |
34 | 34 | { |
35 | 35 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
36 | - $query = isset($options['query']) ? array_filter($options['query'], function ($x) { return !is_null($x); }) : []; |
|
36 | + $query = isset($options['query']) ? array_filter($options['query'], function($x) { return !is_null($x); }) : []; |
|
37 | 37 | |
38 | 38 | $body = isset($options['body']) ? $options['body'] : null; |
39 | 39 | $file = isset($options['FILE']) ? $options['FILE'] : null; |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | |
72 | 72 | curl_setopt_array($ch, $curlOpts); |
73 | 73 | |
74 | - if (null != $file) { |
|
75 | - $cfile = new \CURLFile($file,'',''); |
|
76 | - $body['strFilename']=$cfile; |
|
74 | + if (null!=$file) { |
|
75 | + $cfile = new \CURLFile($file, '', ''); |
|
76 | + $body['strFilename'] = $cfile; |
|
77 | 77 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
78 | - curl_setopt($ch, CURLOPT_POST,true); |
|
78 | + curl_setopt($ch, CURLOPT_POST, true); |
|
79 | 79 | curl_setopt($ch, CURLOPT_POSTFIELDS, $body); |
80 | 80 | } else { |
81 | 81 | switch ($method) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if (isset($body)) { |
94 | 94 | $bodyData = json_encode($body); |
95 | 95 | if (isset($options['HTTPHEADER'])) { |
96 | - if (strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
96 | + if (strpos($options['HTTPHEADER'], 'multipart/form-data')>0) { |
|
97 | 97 | $bodyData = $body; |
98 | 98 | } |
99 | 99 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $isxml = false; |
118 | 118 | $jxml = ''; |
119 | - if (strpos($result, '<?xml') > -1) { |
|
119 | + if (strpos($result, '<?xml')>-1) { |
|
120 | 120 | $xml = simplexml_load_string($result); |
121 | 121 | //$jxml = json_encode($xml); |
122 | 122 | $jxml = self::object2array($xml); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
127 | 127 | curl_close($ch); |
128 | 128 | |
129 | - if (200 == $code) { |
|
129 | + if (200==$code) { |
|
130 | 130 | if ($isxml) { |
131 | 131 | $json = $jxml; |
132 | 132 | } else { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } else { |
139 | 139 | return $json; |
140 | 140 | } |
141 | - } elseif (409 == $code) { |
|
141 | + } elseif (409==$code) { |
|
142 | 142 | throw new ApiError('Wrong API key'); |
143 | 143 | } else { |
144 | 144 | throw new ApiError('Something wrong'); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if (is_object($result1)) { |
179 | 179 | if ($deepPrinting) { |
180 | 180 | echo "<br>$key1 ------><br>"; |
181 | - $oarray = (array) $result1; |
|
181 | + $oarray = (array)$result1; |
|
182 | 182 | self::simplePrint($oarray, true); |
183 | 183 | echo '------<br>'; |
184 | 184 | } else { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if (is_object($result)) { |
196 | 196 | if ($deepPrinting) { |
197 | 197 | echo "<br>$key ------><br>"; |
198 | - $oarray = (array) $result; |
|
198 | + $oarray = (array)$result; |
|
199 | 199 | self::simplePrint($oarray, true); |
200 | 200 | echo '------<br>'; |
201 | 201 | } else { |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class AddressBookLocationSearchResponse |
8 | 8 | { |
9 | - public $results=[]; |
|
9 | + public $results = []; |
|
10 | 10 | public $total; |
11 | - public $fields=[]; |
|
11 | + public $fields = []; |
|
12 | 12 | |
13 | 13 | public static function fromArray(array $params) |
14 | 14 | { |
@@ -208,7 +208,7 @@ |
||
208 | 208 | ], |
209 | 209 | ]); |
210 | 210 | |
211 | - return (bool) $address['deleted']; |
|
211 | + return (bool)$address['deleted']; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | public function moveDestinationToRoute($params) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $zones = [["ZONE 01"], ["ZONE 02"], ["ZONE 03"]]; |
47 | 47 | |
48 | - for($i = 0; $i < 30; ++$i) |
|
48 | + for ($i = 0; $i<30; ++$i) |
|
49 | 49 | { |
50 | 50 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
51 | 51 | 'tags' => [$zones[$i % 3]], |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public static function tearDownAfterClass() |
75 | 75 | { |
76 | - if(!is_null(self::$problem->optimization_problem_id)) |
|
76 | + if (!is_null(self::$problem->optimization_problem_id)) |
|
77 | 77 | { |
78 | 78 | $params = [ |
79 | 79 | 'optimization_problem_ids' => ['0' => self::$problem->optimization_problem_id], |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $result = self::$problem->removeOptimization($params); |
84 | 84 | |
85 | - if ($result != null && $result['status'] == true) { |
|
85 | + if ($result!=null && $result['status']==true) { |
|
86 | 86 | echo "The test optimization was removed <br>"; |
87 | 87 | } else { |
88 | 88 | echo "Cannot remove the test optimization <br>"; |
@@ -324,8 +324,8 @@ |
||
324 | 324 | |
325 | 325 | self::assertNotNull($response); |
326 | 326 | self::assertInstanceOf(Order::class, Order::fromArray($response)); |
327 | - $this->assertEquals(93,$response['custom_user_fields'][0]['order_custom_field_id']); |
|
328 | - $this->assertEquals(false,$response['custom_user_fields'][0]['order_custom_field_value']); |
|
327 | + $this->assertEquals(93, $response['custom_user_fields'][0]['order_custom_field_id']); |
|
328 | + $this->assertEquals(false, $response['custom_user_fields'][0]['order_custom_field_value']); |
|
329 | 329 | |
330 | 330 | self::$createdOrders[] = $response; |
331 | 331 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
19 | 19 | |
20 | 20 | foreach ($routeResults as $routeResult) { |
21 | - $results = (array) $routeResult; |
|
21 | + $results = (array)$routeResult; |
|
22 | 22 | |
23 | 23 | Route4Me::simplePrint($results); |
24 | 24 |
@@ -38,4 +38,4 @@ |
||
38 | 38 | |
39 | 39 | $result = $route->update(); |
40 | 40 | |
41 | -Route4Me::simplePrint((array) $result->parameters); |
|
41 | +Route4Me::simplePrint((array)$result->parameters); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | assert(!is_null($route_id), "Cannot retrieve a random route ID"); |
21 | 21 | |
22 | 22 | // Get a random address ID from selected route above |
23 | -$addressRand = (array) $route->GetRandomAddressFromRoute($route_id); |
|
23 | +$addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
24 | 24 | |
25 | 25 | $route->route_id = $route_id; |
26 | 26 | $route->route_destination_id = $addressRand['route_destination_id']; |