GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 49fd2d...63bb85 )
by Oleg
02:40 queued 42s
created
src/Route4Me/Route.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
 
172 172
     public function mergeRoutes($params)
173 173
     {
174
-        $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat',  'depot_lng');
174
+        $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng');
175 175
         
176 176
         $result = Route4Me::makeRequst(array(
177 177
             'url'    => Endpoint::ROUTES_MERGE,
Please login to merge, or discard this patch.
Indentation   +336 added lines, -336 removed lines patch added patch discarded remove patch
@@ -9,410 +9,410 @@
 block discarded – undo
9 9
 
10 10
 class Route extends Common
11 11
 {
12
-    public $route_id;
13
-    public $member_id;
14
-    public $route_destination_id;
15
-    public $optimization_problem_id;
16
-    public $vehicle_alias;
17
-    public $driver_alias;
18
-    public $trip_distance;
19
-    public $mpg;
20
-    public $gas_price;
21
-    public $route_duration_sec;
22
-    public $destination_count;
23
-    public $parameters;
24
-    public $addresses = array();
25
-    public $links = array();
26
-    public $directions = array();
27
-    public $path = array();
28
-    public $tracking_history = array();
29
-    public $recipient_email;
30
-    public $httpheaders;
31
-    public $is_unrouted;
32
-    public $time;
12
+	public $route_id;
13
+	public $member_id;
14
+	public $route_destination_id;
15
+	public $optimization_problem_id;
16
+	public $vehicle_alias;
17
+	public $driver_alias;
18
+	public $trip_distance;
19
+	public $mpg;
20
+	public $gas_price;
21
+	public $route_duration_sec;
22
+	public $destination_count;
23
+	public $parameters;
24
+	public $addresses = array();
25
+	public $links = array();
26
+	public $directions = array();
27
+	public $path = array();
28
+	public $tracking_history = array();
29
+	public $recipient_email;
30
+	public $httpheaders;
31
+	public $is_unrouted;
32
+	public $time;
33 33
     
34
-    public $dev_lat;
35
-    public $dev_lng;
34
+	public $dev_lat;
35
+	public $dev_lng;
36 36
     
37
-    public $user_route_rating;
38
-    public $member_email;
39
-    public $member_first_name;
40
-    public $member_last_name;
41
-    public $channel_name;
42
-    public $route_cost;
43
-    public $route_revenue;
44
-    public $net_revenue_per_distance_unit;
45
-    public $created_timestamp;
46
-    public $planned_total_route_duration;
47
-    public $actual_travel_distance;
48
-    public $actual_travel_time;
49
-    public $actual_footsteps;
50
-    public $working_time;
51
-    public $driving_time;
52
-    public $idling_time;
53
-    public $paying_miles;
54
-    public $geofence_polygon_type;
55
-    public $geofence_polygon_size;
56
-    public $notes;
57
-    public $member_config_storage;
37
+	public $user_route_rating;
38
+	public $member_email;
39
+	public $member_first_name;
40
+	public $member_last_name;
41
+	public $channel_name;
42
+	public $route_cost;
43
+	public $route_revenue;
44
+	public $net_revenue_per_distance_unit;
45
+	public $created_timestamp;
46
+	public $planned_total_route_duration;
47
+	public $actual_travel_distance;
48
+	public $actual_travel_time;
49
+	public $actual_footsteps;
50
+	public $working_time;
51
+	public $driving_time;
52
+	public $idling_time;
53
+	public $paying_miles;
54
+	public $geofence_polygon_type;
55
+	public $geofence_polygon_size;
56
+	public $notes;
57
+	public $member_config_storage;
58 58
 
59
-    public static function fromArray(array $params) 
60
-    {
61
-        $route = new Route();
62
-        $route->route_id                = Common::getValue($params, 'route_id');
63
-        $route->member_id               = Common::getValue($params, 'member_id');
64
-        $route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id');
65
-        $route->vehicle_alias           = Common::getValue($params, 'vehicle_alias');
66
-        $route->driver_alias            = Common::getValue($params, 'driver_alias');
67
-        $route->trip_distance           = Common::getValue($params, 'trip_distance');
68
-        $route->mpg                     = Common::getValue($params, 'mpg');
69
-        $route->gas_price               = Common::getValue($params, 'gas_price');
70
-        $route->route_duration_sec      = Common::getvalue($params, 'route_duration_sec');
71
-        $route->destination_count       = Common::getvalue($params, 'destination_count');
72
-        $route->is_unrouted             = Common::getvalue($params, 'is_unrouted');
59
+	public static function fromArray(array $params) 
60
+	{
61
+		$route = new Route();
62
+		$route->route_id                = Common::getValue($params, 'route_id');
63
+		$route->member_id               = Common::getValue($params, 'member_id');
64
+		$route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id');
65
+		$route->vehicle_alias           = Common::getValue($params, 'vehicle_alias');
66
+		$route->driver_alias            = Common::getValue($params, 'driver_alias');
67
+		$route->trip_distance           = Common::getValue($params, 'trip_distance');
68
+		$route->mpg                     = Common::getValue($params, 'mpg');
69
+		$route->gas_price               = Common::getValue($params, 'gas_price');
70
+		$route->route_duration_sec      = Common::getvalue($params, 'route_duration_sec');
71
+		$route->destination_count       = Common::getvalue($params, 'destination_count');
72
+		$route->is_unrouted             = Common::getvalue($params, 'is_unrouted');
73 73
 
74
-        // Make RouteParameters
75
-        if (isset($params['parameters'])) {
76
-            $route->parameters = RouteParameters::fromArray($params['parameters']);
77
-        }
74
+		// Make RouteParameters
75
+		if (isset($params['parameters'])) {
76
+			$route->parameters = RouteParameters::fromArray($params['parameters']);
77
+		}
78 78
 
79
-        if (isset($params['addresses'])) {
80
-            $addresses = array();
79
+		if (isset($params['addresses'])) {
80
+			$addresses = array();
81 81
             
82
-            foreach ($params['addresses'] as $address) {
83
-                $addresses[] = Address::fromArray($address);
84
-            }
82
+			foreach ($params['addresses'] as $address) {
83
+				$addresses[] = Address::fromArray($address);
84
+			}
85 85
 
86
-            $route->addresses = $addresses;
87
-        }
86
+			$route->addresses = $addresses;
87
+		}
88 88
 
89
-        $route->links            = Common::getValue($params, 'links', array());
90
-        $route->directions       = Common::getValue($params, 'directions', array());
91
-        $route->path             = Common::getValue($params, 'path', array());
92
-        $route->tracking_history = Common::getValue($params, 'tracking_history', array());
89
+		$route->links            = Common::getValue($params, 'links', array());
90
+		$route->directions       = Common::getValue($params, 'directions', array());
91
+		$route->path             = Common::getValue($params, 'path', array());
92
+		$route->tracking_history = Common::getValue($params, 'tracking_history', array());
93 93
 
94
-        return $route;
95
-    }
94
+		return $route;
95
+	}
96 96
 
97
-    public static function getRoutes($params = null)
98
-    {
99
-        $allQueryFields = array('route_id', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset');
97
+	public static function getRoutes($params = null)
98
+	{
99
+		$allQueryFields = array('route_id', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset');
100 100
         
101
-        $result = Route4Me::makeRequst(array(
102
-            'url'    => Endpoint::ROUTE_V4,
103
-            'method' => 'GET',
104
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
105
-        ));
101
+		$result = Route4Me::makeRequst(array(
102
+			'url'    => Endpoint::ROUTE_V4,
103
+			'method' => 'GET',
104
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
105
+		));
106 106
 
107
-        if (isset($params['route_id'])) {
108
-            return Route::fromArray($result);
109
-        } else {
110
-            $routes = array();
111
-            foreach ($result as $route) {
112
-                $routes[] = Route::fromArray($route);
113
-            }
114
-            return $routes;
115
-        }
116
-    }
107
+		if (isset($params['route_id'])) {
108
+			return Route::fromArray($result);
109
+		} else {
110
+			$routes = array();
111
+			foreach ($result as $route) {
112
+				$routes[] = Route::fromArray($route);
113
+			}
114
+			return $routes;
115
+		}
116
+	}
117 117
 
118
-    public function getRoutePoints($params)
119
-    {
120
-        $allQueryFields = array('route_id', 'route_path_output', 'compress_path_points', 'directions');
118
+	public function getRoutePoints($params)
119
+	{
120
+		$allQueryFields = array('route_id', 'route_path_output', 'compress_path_points', 'directions');
121 121
         
122
-        $result = Route4Me::makeRequst(array(
123
-            'url'    => Endpoint::ROUTE_V4,
124
-            'method' => 'GET',
125
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
126
-        ));
122
+		$result = Route4Me::makeRequst(array(
123
+			'url'    => Endpoint::ROUTE_V4,
124
+			'method' => 'GET',
125
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
126
+		));
127 127
 
128
-        return $result;
129
-    }
128
+		return $result;
129
+	}
130 130
 
131
-    public function duplicateRoute($route_id)
132
-    {
133
-        $result = Route4Me::makeRequst(array(
134
-            'url'    => Endpoint::ROUTE_DUPLICATE,
135
-            'method' => 'GET',
136
-            'query'  => array(
137
-                'route_id' => $route_id,
138
-                'to'       => 'none',
139
-            )
140
-        ));
131
+	public function duplicateRoute($route_id)
132
+	{
133
+		$result = Route4Me::makeRequst(array(
134
+			'url'    => Endpoint::ROUTE_DUPLICATE,
135
+			'method' => 'GET',
136
+			'query'  => array(
137
+				'route_id' => $route_id,
138
+				'to'       => 'none',
139
+			)
140
+		));
141 141
         
142
-        return $result;
143
-    }
142
+		return $result;
143
+	}
144 144
     
145
-    public function resequenceRoute($params)
146
-    {
147
-        $allQueryFields = array('route_id', 'route_destination_id');
148
-        $allBodyFields = array('addresses');
145
+	public function resequenceRoute($params)
146
+	{
147
+		$allQueryFields = array('route_id', 'route_destination_id');
148
+		$allBodyFields = array('addresses');
149 149
         
150
-        $result = Route4Me::makeRequst(array(
151
-            'url'    => Endpoint::ROUTE_V4,
152
-            'method' => 'PUT',
153
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
154
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
155
-        ));
150
+		$result = Route4Me::makeRequst(array(
151
+			'url'    => Endpoint::ROUTE_V4,
152
+			'method' => 'PUT',
153
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
154
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
155
+		));
156 156
         
157
-        return $result;
158
-    }
157
+		return $result;
158
+	}
159 159
     
160
-    public function resequenceAllAddresses($params)
161
-    {
162
-        $allQueryFields = array('route_id', 'disable_optimization', 'optimize');
160
+	public function resequenceAllAddresses($params)
161
+	{
162
+		$allQueryFields = array('route_id', 'disable_optimization', 'optimize');
163 163
         
164
-        $result = Route4Me::makeRequst(array(
165
-            'url'    => Endpoint::REOPTIMIZE_V3_2,
166
-            'method' => 'GET',
167
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
168
-        ));
164
+		$result = Route4Me::makeRequst(array(
165
+			'url'    => Endpoint::REOPTIMIZE_V3_2,
166
+			'method' => 'GET',
167
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
168
+		));
169 169
         
170
-        return $result;
171
-    }
170
+		return $result;
171
+	}
172 172
 
173
-    public function mergeRoutes($params)
174
-    {
175
-        $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat',  'depot_lng');
173
+	public function mergeRoutes($params)
174
+	{
175
+		$allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat',  'depot_lng');
176 176
         
177
-        $result = Route4Me::makeRequst(array(
178
-            'url'    => Endpoint::ROUTES_MERGE,
179
-            'method' => 'POST',
180
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
181
-            'HTTPHEADER'  => 'Content-Type: multipart/form-data'
182
-        ));
177
+		$result = Route4Me::makeRequst(array(
178
+			'url'    => Endpoint::ROUTES_MERGE,
179
+			'method' => 'POST',
180
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
181
+			'HTTPHEADER'  => 'Content-Type: multipart/form-data'
182
+		));
183 183
         
184
-        return $result;
185
-    }
184
+		return $result;
185
+	}
186 186
     
187
-    public function shareRoute($params)
188
-    {
189
-        $allQueryFields = array('route_id', 'response_format');
190
-        $allBodyFields = array('recipient_email');
187
+	public function shareRoute($params)
188
+	{
189
+		$allQueryFields = array('route_id', 'response_format');
190
+		$allBodyFields = array('recipient_email');
191 191
         
192
-        $result = Route4Me::makeRequst(array(
193
-            'url'    => Endpoint::ROUTE_SHARE,
194
-            'method' => 'POST',
195
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
196
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
197
-            'HTTPHEADER'  => 'Content-Type: multipart/form-data'
198
-        ));
192
+		$result = Route4Me::makeRequst(array(
193
+			'url'    => Endpoint::ROUTE_SHARE,
194
+			'method' => 'POST',
195
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
196
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
197
+			'HTTPHEADER'  => 'Content-Type: multipart/form-data'
198
+		));
199 199
         
200
-        return $result;
201
-    }
200
+		return $result;
201
+	}
202 202
     
203
-    // Returns random route_id from existing routes between $offset and $offset+$limit
204
-    public function getRandomRouteId($offset, $limit)
205
-    {
206
-        $params = array(
207
-            'offset' => !is_null($offset) ? $offset : 0,
208
-            'limit'  => !is_null($limit) ? $limit : 30
209
-        );
203
+	// Returns random route_id from existing routes between $offset and $offset+$limit
204
+	public function getRandomRouteId($offset, $limit)
205
+	{
206
+		$params = array(
207
+			'offset' => !is_null($offset) ? $offset : 0,
208
+			'limit'  => !is_null($limit) ? $limit : 30
209
+		);
210 210
         
211
-        $routes = $this->getRoutes($params);
211
+		$routes = $this->getRoutes($params);
212 212
         
213
-        if (is_null($routes) || sizeof($routes)<1) {
214
-            echo "<br> There are no routes in the account. Please, create the routes first. <br>";
215
-            return null;
216
-        } 
213
+		if (is_null($routes) || sizeof($routes)<1) {
214
+			echo "<br> There are no routes in the account. Please, create the routes first. <br>";
215
+			return null;
216
+		} 
217 217
         
218
-        $randomIndex = rand(0, sizeof($routes) - 1);
218
+		$randomIndex = rand(0, sizeof($routes) - 1);
219 219
         
220
-        return $routes[$randomIndex]->route_id;
221
-    }
220
+		return $routes[$randomIndex]->route_id;
221
+	}
222 222
 
223
-    public function update()
224
-    {
225
-        $route = Route4Me::makeRequst(array(
226
-            'url'    => Endpoint::ROUTE_V4,
227
-            'method' => 'PUT',
228
-            'query'  => array(
229
-                'route_id'  => isset($this->route_id) ? $this->route_id : null
230
-            ),
231
-            'body' => array(
232
-                'parameters' => $this->parameters,
233
-                ),
234
-            'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
235
-        ));
223
+	public function update()
224
+	{
225
+		$route = Route4Me::makeRequst(array(
226
+			'url'    => Endpoint::ROUTE_V4,
227
+			'method' => 'PUT',
228
+			'query'  => array(
229
+				'route_id'  => isset($this->route_id) ? $this->route_id : null
230
+			),
231
+			'body' => array(
232
+				'parameters' => $this->parameters,
233
+				),
234
+			'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
235
+		));
236 236
 
237
-        return Route::fromArray($route);
238
-    }
237
+		return Route::fromArray($route);
238
+	}
239 239
     
240
-    public function updateAddress($address = null)
241
-    {
242
-        $body = sizeof($this->addresses)<1 ? get_object_vars($this->parameters) 
243
-            : (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters));
240
+	public function updateAddress($address = null)
241
+	{
242
+		$body = sizeof($this->addresses)<1 ? get_object_vars($this->parameters) 
243
+			: (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters));
244 244
 
245
-        $result = Route4Me::makeRequst(array(
246
-            'url'    => Endpoint::ADDRESS_V4,
247
-            'method' => 'PUT',
248
-            'query'  => array(
249
-                'route_id'             => isset($this->route_id) ? $this->route_id : null,
250
-                'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
251
-            ),
252
-            'body'        => $body,
253
-            'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
254
-        ));
245
+		$result = Route4Me::makeRequst(array(
246
+			'url'    => Endpoint::ADDRESS_V4,
247
+			'method' => 'PUT',
248
+			'query'  => array(
249
+				'route_id'             => isset($this->route_id) ? $this->route_id : null,
250
+				'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
251
+			),
252
+			'body'        => $body,
253
+			'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
254
+		));
255 255
 
256
-        return $result;
257
-    }
256
+		return $result;
257
+	}
258 258
 
259
-    public function updateRouteAddress()
260
-    {
261
-        $result = Route4Me::makeRequst(array(
262
-            'url'    => Endpoint::ADDRESS_V4,
263
-            'method' => 'PUT',
264
-            'query'  => array(
265
-                'route_id'             => isset($this->route_id) ? $this->route_id : null,
266
-                'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
267
-            ),
268
-            'body'        => array(
269
-                "parameters" => isset($this->parameters) ? get_object_vars($this->parameters) : null,
270
-                "addresses"  => isset($this->addresses) ? $this->addresses : null
271
-            ),
272
-            'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
273
-        ));
259
+	public function updateRouteAddress()
260
+	{
261
+		$result = Route4Me::makeRequst(array(
262
+			'url'    => Endpoint::ADDRESS_V4,
263
+			'method' => 'PUT',
264
+			'query'  => array(
265
+				'route_id'             => isset($this->route_id) ? $this->route_id : null,
266
+				'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
267
+			),
268
+			'body'        => array(
269
+				"parameters" => isset($this->parameters) ? get_object_vars($this->parameters) : null,
270
+				"addresses"  => isset($this->addresses) ? $this->addresses : null
271
+			),
272
+			'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
273
+		));
274 274
 
275
-        return $result;
276
-    }
275
+		return $result;
276
+	}
277 277
 
278
-    public function addAddresses($params)
279
-    {
280
-        $allQueryFields = array('route_id');
281
-        $allBodyFields = array('addresses');
278
+	public function addAddresses($params)
279
+	{
280
+		$allQueryFields = array('route_id');
281
+		$allBodyFields = array('addresses');
282 282
         
283
-        $route = Route4Me::makeRequst(array(
284
-            'url'    => Endpoint::ROUTE_V4,
285
-            'method' => 'PUT',
286
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
287
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
288
-            'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
289
-        ));
283
+		$route = Route4Me::makeRequst(array(
284
+			'url'    => Endpoint::ROUTE_V4,
285
+			'method' => 'PUT',
286
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
287
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
288
+			'HTTPHEADER'  => isset($this->httpheaders) ? $this->httpheaders : null,
289
+		));
290 290
 
291
-        return Route::fromArray($route);
292
-    }
291
+		return Route::fromArray($route);
292
+	}
293 293
     
294
-    public function insertAddressOptimalPosition(array $params)
295
-    {
296
-        $allQueryFields = array('route_id');
297
-        $allBodyFields = array('addresses', 'optimal_position');
294
+	public function insertAddressOptimalPosition(array $params)
295
+	{
296
+		$allQueryFields = array('route_id');
297
+		$allBodyFields = array('addresses', 'optimal_position');
298 298
         
299
-        $route = Route4Me::makeRequst(array(
300
-            'url'    => Endpoint::ROUTE_V4,
301
-            'method' => 'PUT',
302
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
303
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
304
-        ));
299
+		$route = Route4Me::makeRequst(array(
300
+			'url'    => Endpoint::ROUTE_V4,
301
+			'method' => 'PUT',
302
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
303
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
304
+		));
305 305
 
306
-        return Route::fromArray($route);
307
-    }
306
+		return Route::fromArray($route);
307
+	}
308 308
     
309
-    public function addNoteFile($params)
310
-    {
311
-        $fname = isset($params['strFilename']) ? $params['strFilename'] : null;
312
-        $rpath = realpath($fname);
309
+	public function addNoteFile($params)
310
+	{
311
+		$fname = isset($params['strFilename']) ? $params['strFilename'] : null;
312
+		$rpath = realpath($fname);
313 313
         
314
-        $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type');
315
-        $allBodyFields = array('strUpdateType', 'strFilename', 'strNoteContents');
314
+		$allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type');
315
+		$allBodyFields = array('strUpdateType', 'strFilename', 'strNoteContents');
316 316
         
317
-        $result = Route4Me::makeRequst(array(
318
-            'url'    => Endpoint::ROUTE_NOTES_ADD,
319
-            'method' => 'POST',
320
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
321
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
322
-            'FILE'   => $rpath,
323
-            'HTTPHEADER' => array(
324
-                'Content-Type: application/x-www-form-urlencoded'
325
-            )
326
-        ));
317
+		$result = Route4Me::makeRequst(array(
318
+			'url'    => Endpoint::ROUTE_NOTES_ADD,
319
+			'method' => 'POST',
320
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
321
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
322
+			'FILE'   => $rpath,
323
+			'HTTPHEADER' => array(
324
+				'Content-Type: application/x-www-form-urlencoded'
325
+			)
326
+		));
327 327
 
328
-        return $result;
329
-    }
328
+		return $result;
329
+	}
330 330
 
331
-    public function deleteRoutes($route_id)
332
-    {
333
-         $result = Route4Me::makeRequst(array(
334
-            'url'    => Endpoint::ROUTES_DELETE,
335
-            'method' => 'DELETE',
336
-            'query'  => array(
337
-                'route_id' => $route_id,
338
-            )
339
-        ));
331
+	public function deleteRoutes($route_id)
332
+	{
333
+		 $result = Route4Me::makeRequst(array(
334
+			'url'    => Endpoint::ROUTES_DELETE,
335
+			'method' => 'DELETE',
336
+			'query'  => array(
337
+				'route_id' => $route_id,
338
+			)
339
+		));
340 340
         
341
-        return $result;
342
-    }
341
+		return $result;
342
+	}
343 343
     
344
-    public function GetAddressesFromRoute($route_id)
345
-    {
346
-        $route1 = Route::getRoutes(array('route_id' => $route_id));
344
+	public function GetAddressesFromRoute($route_id)
345
+	{
346
+		$route1 = Route::getRoutes(array('route_id' => $route_id));
347 347
         
348
-        if (isset($route1)) {
349
-            return $route1->addresses;
350
-        } else {
351
-            return null;
352
-        }
353
-    }
348
+		if (isset($route1)) {
349
+			return $route1->addresses;
350
+		} else {
351
+			return null;
352
+		}
353
+	}
354 354
     
355
-    public function GetRandomAddressFromRoute($route_id)
356
-    {
357
-        $route1 = Route::getRoutes(array('route_id' => $route_id));
355
+	public function GetRandomAddressFromRoute($route_id)
356
+	{
357
+		$route1 = Route::getRoutes(array('route_id' => $route_id));
358 358
         
359
-        if (isset($route1)) {
360
-            $addresses = $route1->addresses;
359
+		if (isset($route1)) {
360
+			$addresses = $route1->addresses;
361 361
             
362
-            $rnd = rand(0, sizeof($addresses) - 1);
362
+			$rnd = rand(0, sizeof($addresses) - 1);
363 363
             
364
-            return $addresses[$rnd];
365
-        } else {
366
-            return null;
367
-        }
368
-    }
364
+			return $addresses[$rnd];
365
+		} else {
366
+			return null;
367
+		}
368
+	}
369 369
 
370
-    public function getRouteId()
371
-    {
372
-        return $this->route_id;
373
-    }
370
+	public function getRouteId()
371
+	{
372
+		return $this->route_id;
373
+	}
374 374
 
375
-    public function getOptimizationId()
376
-    {
377
-        return $this->optimization_problem_id;
378
-    }
375
+	public function getOptimizationId()
376
+	{
377
+		return $this->optimization_problem_id;
378
+	}
379 379
     
380
-    public function GetLastLocation(array $params)
381
-    {
382
-        $allQueryFields = array('route_id', 'device_tracking_history');
380
+	public function GetLastLocation(array $params)
381
+	{
382
+		$allQueryFields = array('route_id', 'device_tracking_history');
383 383
         
384
-        $route = Route4Me::makeRequst(array(
385
-            'url'    => Endpoint::ROUTE_V4,
386
-            'method' => 'GET',
387
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
388
-        ));
384
+		$route = Route4Me::makeRequst(array(
385
+			'url'    => Endpoint::ROUTE_V4,
386
+			'method' => 'GET',
387
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
388
+		));
389 389
 
390
-        return Route::fromArray($route);
391
-    }
390
+		return Route::fromArray($route);
391
+	}
392 392
     
393
-    public function GetTrackingHistoryFromTimeRange(array $params)
394
-    {
395
-        $allQueryFields = array('route_id', 'format', 'time_period', 'start_date', 'end_date');
393
+	public function GetTrackingHistoryFromTimeRange(array $params)
394
+	{
395
+		$allQueryFields = array('route_id', 'format', 'time_period', 'start_date', 'end_date');
396 396
         
397
-        $route = Route4Me::makeRequst(array(
398
-            'url'    => Endpoint::GET_DEVICE_LOCATION,
399
-            'method' => 'GET',
400
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
401
-        ));
397
+		$route = Route4Me::makeRequst(array(
398
+			'url'    => Endpoint::GET_DEVICE_LOCATION,
399
+			'method' => 'GET',
400
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
401
+		));
402 402
 
403
-        return $route;
404
-    }
403
+		return $route;
404
+	}
405 405
     
406
-    public function GetAssetTracking(array $params)
407
-    {
408
-        $allQueryFields = array('tracking');
406
+	public function GetAssetTracking(array $params)
407
+	{
408
+		$allQueryFields = array('tracking');
409 409
         
410
-        $route = Route4Me::makeRequst(array(
411
-            'url'    => Endpoint::STATUS_V4,
412
-            'method' => 'GET',
413
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
414
-        ));
410
+		$route = Route4Me::makeRequst(array(
411
+			'url'    => Endpoint::STATUS_V4,
412
+			'method' => 'GET',
413
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
414
+		));
415 415
 
416
-        return $route;
417
-    }
416
+		return $route;
417
+	}
418 418
 }
Please login to merge, or discard this patch.
src/Route4Me/AddressBookLocation.php 2 patches
Switch Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -351,70 +351,70 @@
 block discarded – undo
351 351
             
352 352
             if ($mode!='daily') {
353 353
                 switch ($mode) {
354
-                    case 'weekly':
355
-                        if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) {
356
-                            if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) {
357
-                                 $curSchedule .= '"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}';
358
-                            } else {
359
-                                array_push($results['fail'], "$iRow --> Wrong weekdays"); 
360
-                            }
354
+                case 'weekly':
355
+                    if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) {
356
+                        if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) {
357
+                             $curSchedule .= '"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}';
361 358
                         } else {
362
-                            array_push($results['fail'], "$iRow --> The parameters sched_weekdays is not set"); 
359
+                            array_push($results['fail'], "$iRow --> Wrong weekdays"); 
363 360
                         }
364
-                        break;
365
-                    case 'monthly':
366
-                        $monthlyMode = "";
367
-                        if (isset($rows[$locationsFieldsMapping['monthly_mode']])) {
368
-                            if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) {
369
-                                 $monthlyMode = $rows[$locationsFieldsMapping['monthly_mode']];
370
-                                 $curSchedule .= '"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",';
371
-                            } else {
372
-                                array_push($results['fail'], "$iRow --> Wrong monthly mode"); 
373
-                            }
361
+                    } else {
362
+                        array_push($results['fail'], "$iRow --> The parameters sched_weekdays is not set"); 
363
+                    }
364
+                    break;
365
+                case 'monthly':
366
+                    $monthlyMode = "";
367
+                    if (isset($rows[$locationsFieldsMapping['monthly_mode']])) {
368
+                        if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) {
369
+                             $monthlyMode = $rows[$locationsFieldsMapping['monthly_mode']];
370
+                             $curSchedule .= '"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",';
374 371
                         } else {
375
-                            array_push($results['fail'], "$iRow --> The parameter sched_monthly_mode is not set"); 
372
+                            array_push($results['fail'], "$iRow --> Wrong monthly mode"); 
376 373
                         }
374
+                    } else {
375
+                        array_push($results['fail'], "$iRow --> The parameter sched_monthly_mode is not set"); 
376
+                    }
377 377
                         
378
-                        if ($monthlyMode!="") {
379
-                            switch ($monthlyMode) {
380
-                                case 'dates':
381
-                                    if (isset($rows[$locationsFieldsMapping['monthly_dates']])) {
382
-                                        if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) {
383
-                                             $curSchedule .= '"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}';
384
-                                        } else {
385
-                                            array_push($results['fail'], "$iRow --> Wrong monthly dates"); 
386
-                                        }
387
-                                    }
388
-                                    break;
389
-                                case 'nth':
390
-                                    if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) {
391
-                                        if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) {
392
-                                             $curSchedule .= '"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].',';
393
-                                        } else {
394
-                                            array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_n"); 
395
-                                        }
396
-                                    } else {
397
-                                        array_push($results['fail'], "$iRow --> The parameter sched_nth_n is not set"); 
398
-                                    }
378
+                    if ($monthlyMode!="") {
379
+                        switch ($monthlyMode) {
380
+                        case 'dates':
381
+                        if (isset($rows[$locationsFieldsMapping['monthly_dates']])) {
382
+                        if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) {
383
+                             $curSchedule .= '"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}';
384
+                        } else {
385
+                            array_push($results['fail'], "$iRow --> Wrong monthly dates"); 
386
+                        }
387
+                        }
388
+                        break;
389
+                        case 'nth':
390
+                        if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) {
391
+                        if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) {
392
+                             $curSchedule .= '"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].',';
393
+                        } else {
394
+                            array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_n"); 
395
+                        }
396
+                        } else {
397
+                        array_push($results['fail'], "$iRow --> The parameter sched_nth_n is not set"); 
398
+                        }
399 399
                                     
400
-                                    if ($curSchedule!="") {
401
-                                        if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
402
-                                            if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
403
-                                                 $curSchedule .= '"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}';
404
-                                            } else {
405
-                                                array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_what"); 
406
-                                            }
407
-                                        } else {
408
-                                            array_push($results['fail'], "$iRow --> The parameter sched_nth_what is not set"); 
409
-                                        }
410
-                                    }
411
-                                    break;
400
+                        if ($curSchedule!="") {
401
+                        if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
402
+                            if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
403
+                                 $curSchedule .= '"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}';
404
+                            } else {
405
+                                array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_what"); 
412 406
                             }
407
+                        } else {
408
+                            array_push($results['fail'], "$iRow --> The parameter sched_nth_what is not set"); 
409
+                        }
413 410
                         }
414 411
                         break;
415
-                    default:
416
-                        $curSchedule = "";
412
+                        }
413
+                        }
417 414
                         break;
415
+                default:
416
+                    $curSchedule = "";
417
+                    break;
418 418
                 }
419 419
             }
420 420
 
Please login to merge, or discard this patch.
Indentation   +371 added lines, -371 removed lines patch added patch discarded remove patch
@@ -6,452 +6,452 @@
 block discarded – undo
6 6
 
7 7
 class AddressBookLocation extends Common
8 8
 {
9
-    public $address_id;
10
-    public $address_group;
11
-    public $address_alias;
12
-    public $address_1;
13
-    public $address_2;
14
-    public $first_name;
15
-    public $last_name;
16
-    public $address_email;
17
-    public $address_phone_number;
18
-    public $address_city;
19
-    public $address_state_id;
20
-    public $address_country_id;
21
-    public $address_zip;
22
-    public $cached_lat;
23
-    public $cached_lng;
24
-    public $curbside_lat;
25
-    public $curbside_lng;
26
-    public $color;
27
-    public $address_custom_data;
28
-    public $schedule;
9
+	public $address_id;
10
+	public $address_group;
11
+	public $address_alias;
12
+	public $address_1;
13
+	public $address_2;
14
+	public $first_name;
15
+	public $last_name;
16
+	public $address_email;
17
+	public $address_phone_number;
18
+	public $address_city;
19
+	public $address_state_id;
20
+	public $address_country_id;
21
+	public $address_zip;
22
+	public $cached_lat;
23
+	public $cached_lng;
24
+	public $curbside_lat;
25
+	public $curbside_lng;
26
+	public $color;
27
+	public $address_custom_data;
28
+	public $schedule;
29 29
     
30
-    public $created_timestamp;
31
-    public $member_id;
32
-    public $schedule_blacklist;
33
-    public $in_route_count;
34
-    public $last_visited_timestamp;
35
-    public $last_routed_timestamp;
36
-    public $local_time_window_start;
37
-    public $local_time_window_end;
38
-    public $local_time_window_start_2;
39
-    public $local_time_window_end_2;
40
-    public $service_time;
41
-    public $local_timezone_string;
42
-    public $address_icon;
43
-    public $address_stop_type;
44
-    public $address_cube;
45
-    public $address_pieces;
46
-    public $address_reference_no;
47
-    public $address_revenue;
48
-    public $address_weight;
49
-    public $address_priority;
50
-    public $address_customer_po;
30
+	public $created_timestamp;
31
+	public $member_id;
32
+	public $schedule_blacklist;
33
+	public $in_route_count;
34
+	public $last_visited_timestamp;
35
+	public $last_routed_timestamp;
36
+	public $local_time_window_start;
37
+	public $local_time_window_end;
38
+	public $local_time_window_start_2;
39
+	public $local_time_window_end_2;
40
+	public $service_time;
41
+	public $local_timezone_string;
42
+	public $address_icon;
43
+	public $address_stop_type;
44
+	public $address_cube;
45
+	public $address_pieces;
46
+	public $address_reference_no;
47
+	public $address_revenue;
48
+	public $address_weight;
49
+	public $address_priority;
50
+	public $address_customer_po;
51 51
     
52
-    public static function fromArray(array $params)
53
-    {
54
-        $addressbooklocation = new AddressBookLocation();
52
+	public static function fromArray(array $params)
53
+	{
54
+		$addressbooklocation = new AddressBookLocation();
55 55
         
56
-        foreach ($params as $key => $value) {
57
-            if (property_exists($addressbooklocation, $key)) {
58
-                $addressbooklocation->{$key} = $value;
59
-            }
60
-        }
56
+		foreach ($params as $key => $value) {
57
+			if (property_exists($addressbooklocation, $key)) {
58
+				$addressbooklocation->{$key} = $value;
59
+			}
60
+		}
61 61
         
62
-        return $addressbooklocation;
63
-    }
62
+		return $addressbooklocation;
63
+	}
64 64
     
65 65
     
66 66
     
67
-    public static function getAddressBookLocation($addressId)
68
-    {
69
-        $ablocations = Route4Me::makeRequst(array(
70
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
71
-            'method' => 'GET',
72
-            'query'  => array(
73
-                'query' => $addressId,
74
-                'limit' => 30
75
-            )
76
-        ));
67
+	public static function getAddressBookLocation($addressId)
68
+	{
69
+		$ablocations = Route4Me::makeRequst(array(
70
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
71
+			'method' => 'GET',
72
+			'query'  => array(
73
+				'query' => $addressId,
74
+				'limit' => 30
75
+			)
76
+		));
77 77
 
78
-        return $ablocations;
79
-    }
78
+		return $ablocations;
79
+	}
80 80
     
81
-    public static function searchAddressBookLocations($params)
82
-    {
83
-        $allQueryFields = array('display', 'query', 'fields', 'limit', 'offset');
81
+	public static function searchAddressBookLocations($params)
82
+	{
83
+		$allQueryFields = array('display', 'query', 'fields', 'limit', 'offset');
84 84
         
85
-        $result = Route4Me::makeRequst(array(
86
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
87
-            'method' => 'GET',
88
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
89
-        ));
85
+		$result = Route4Me::makeRequst(array(
86
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
87
+			'method' => 'GET',
88
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
89
+		));
90 90
 
91
-        return $result;
92
-    }
91
+		return $result;
92
+	}
93 93
     
94
-    public static function getAddressBookLocations($params)
95
-    {
96
-        $allQueryFields = array('limit', 'offset', 'address_id');
94
+	public static function getAddressBookLocations($params)
95
+	{
96
+		$allQueryFields = array('limit', 'offset', 'address_id');
97 97
         
98
-        $ablocations = Route4Me::makeRequst(array(
99
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
100
-            'method' => 'GET',
101
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
102
-        ));
98
+		$ablocations = Route4Me::makeRequst(array(
99
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
100
+			'method' => 'GET',
101
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params)
102
+		));
103 103
 
104
-        return $ablocations;
105
-    }
104
+		return $ablocations;
105
+	}
106 106
     
107
-    public static function getRandomAddressBookLocation($params)
108
-    {
109
-        $ablocations = self::getAddressBookLocations($params);
107
+	public static function getRandomAddressBookLocation($params)
108
+	{
109
+		$ablocations = self::getAddressBookLocations($params);
110 110
         
111
-        if (isset($ablocations["results"])) {
112
-            $locationsSize = sizeof($ablocations["results"]);
111
+		if (isset($ablocations["results"])) {
112
+			$locationsSize = sizeof($ablocations["results"]);
113 113
             
114
-            if ($locationsSize>0) {
115
-                $randomLocationIndex = rand(0, $locationsSize - 1);
116
-                return $ablocations["results"][$randomLocationIndex];
117
-            } 
118
-        } 
114
+			if ($locationsSize>0) {
115
+				$randomLocationIndex = rand(0, $locationsSize - 1);
116
+				return $ablocations["results"][$randomLocationIndex];
117
+			} 
118
+		} 
119 119
 
120
-        return null;
121
-    }
120
+		return null;
121
+	}
122 122
     
123
-    /**
124
-     * @param AddressBookLocation $params
125
-    */
126
-    public static function addAdressBookLocation($params)
127
-    {
128
-        $allBodyFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('address_id', 'in_route_count'));
123
+	/**
124
+	 * @param AddressBookLocation $params
125
+	 */
126
+	public static function addAdressBookLocation($params)
127
+	{
128
+		$allBodyFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('address_id', 'in_route_count'));
129 129
         
130
-        $response = Route4Me::makeRequst(array(
131
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
132
-            'method' => 'POST',
133
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
134
-        ));
130
+		$response = Route4Me::makeRequst(array(
131
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
132
+			'method' => 'POST',
133
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
134
+		));
135 135
 
136
-        return $response;
137
-    }
136
+		return $response;
137
+	}
138 138
     
139
-    public function deleteAdressBookLocation($address_ids)
140
-    {
141
-        $result = Route4Me::makeRequst(array(
142
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
143
-            'method' => 'DELETEARRAY',
144
-            'query'  => array(
145
-                'address_ids' => $address_ids
146
-            )
147
-        ));
139
+	public function deleteAdressBookLocation($address_ids)
140
+	{
141
+		$result = Route4Me::makeRequst(array(
142
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
143
+			'method' => 'DELETEARRAY',
144
+			'query'  => array(
145
+				'address_ids' => $address_ids
146
+			)
147
+		));
148 148
 
149
-        return $result;
150
-    }
149
+		return $result;
150
+	}
151 151
     
152
-    public function updateAdressBookLocation($params)
153
-    {
154
-        $allBodyFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('in_route_count'));
152
+	public function updateAdressBookLocation($params)
153
+	{
154
+		$allBodyFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('in_route_count'));
155 155
 
156
-        $response = Route4Me::makeRequst(array(
157
-            'url'    => Endpoint::ADDRESS_BOOK_V4,
158
-            'method' => 'PUT',
159
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
160
-        ));
156
+		$response = Route4Me::makeRequst(array(
157
+			'url'    => Endpoint::ADDRESS_BOOK_V4,
158
+			'method' => 'PUT',
159
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params)
160
+		));
161 161
 
162
-        return $response;
163
-    }
162
+		return $response;
163
+	}
164 164
         
165
-    public static function validateScheduleMode($scheduleMode)
166
-    {
167
-        $schedMmodes = array("daily", "weekly", "monthly", "annually");
165
+	public static function validateScheduleMode($scheduleMode)
166
+	{
167
+		$schedMmodes = array("daily", "weekly", "monthly", "annually");
168 168
         
169
-        if (in_array($scheduleMode, $schedMmodes)) {
170
-            return TRUE; 
171
-        } else {
172
-            return FALSE;
173
-        }
174
-    }
169
+		if (in_array($scheduleMode, $schedMmodes)) {
170
+			return TRUE; 
171
+		} else {
172
+			return FALSE;
173
+		}
174
+	}
175 175
     
176
-    public static function validateScheduleEnable($scheduleEnabled)
177
-    {
178
-        $schedEnables = array(TRUE, FALSE);
176
+	public static function validateScheduleEnable($scheduleEnabled)
177
+	{
178
+		$schedEnables = array(TRUE, FALSE);
179 179
         
180
-        if (in_array($scheduleEnabled, $schedEnables)) {
181
-            return TRUE;
182
-        } else {
183
-            return FALSE;
184
-        }
185
-    }
180
+		if (in_array($scheduleEnabled, $schedEnables)) {
181
+			return TRUE;
182
+		} else {
183
+			return FALSE;
184
+		}
185
+	}
186 186
     
187
-    public static function validateScheduleEvery($scheduleEvery)
188
-    {
189
-        if (is_numeric($scheduleEvery)) {
190
-            return TRUE;
191
-        } else {
192
-            return FALSE;
193
-        }
194
-    }
187
+	public static function validateScheduleEvery($scheduleEvery)
188
+	{
189
+		if (is_numeric($scheduleEvery)) {
190
+			return TRUE;
191
+		} else {
192
+			return FALSE;
193
+		}
194
+	}
195 195
     
196
-    public static function validateScheduleWeekDays($scheduleWeekDays)
197
-    {
198
-        $weekdays = explode(',', $scheduleWeekDays);
199
-        $weekdaysSize = sizeof($weekdays);
196
+	public static function validateScheduleWeekDays($scheduleWeekDays)
197
+	{
198
+		$weekdays = explode(',', $scheduleWeekDays);
199
+		$weekdaysSize = sizeof($weekdays);
200 200
         
201
-        if ($weekdaysSize<1) {
202
-            return FALSE;
203
-        }
201
+		if ($weekdaysSize<1) {
202
+			return FALSE;
203
+		}
204 204
         
205
-        $isValid = TRUE;
205
+		$isValid = TRUE;
206 206
         
207
-        for ($i = 0; $i<$weekdaysSize; $i++) { 
208
-            if (is_numeric($weekdays[$i])) {
209
-                $wday = intval($weekdays[$i]);
210
-                if ($wday<1 || $wday>7) {
211
-                    $isValid = FALSE;
212
-                }
213
-            } else {
214
-                $isValid = FALSE;
215
-            }
216
-        }
207
+		for ($i = 0; $i<$weekdaysSize; $i++) { 
208
+			if (is_numeric($weekdays[$i])) {
209
+				$wday = intval($weekdays[$i]);
210
+				if ($wday<1 || $wday>7) {
211
+					$isValid = FALSE;
212
+				}
213
+			} else {
214
+				$isValid = FALSE;
215
+			}
216
+		}
217 217
         
218
-        return $isValid;
219
-    }
218
+		return $isValid;
219
+	}
220 220
     
221
-    public static function validateScheduleMonthlyMode($scheduleMonthlyMode)
222
-    {
223
-        $schedMonthlyMmodes = array("dates", "nth");
221
+	public static function validateScheduleMonthlyMode($scheduleMonthlyMode)
222
+	{
223
+		$schedMonthlyMmodes = array("dates", "nth");
224 224
         
225
-        if (in_array($scheduleMonthlyMode, $schedMonthlyMmodes)) {
226
-            return TRUE;
227
-        } else {
228
-            return FALSE;
229
-        }
230
-    }
225
+		if (in_array($scheduleMonthlyMode, $schedMonthlyMmodes)) {
226
+			return TRUE;
227
+		} else {
228
+			return FALSE;
229
+		}
230
+	}
231 231
     
232
-    public static function validateScheduleMonthlyDates($scheduleMonthlyDates)
233
-    {
234
-        $monthlyDates = explode(',', $scheduleMonthlyDates);
235
-        $monthlyDatesSize = sizeof($monthlyDates);
232
+	public static function validateScheduleMonthlyDates($scheduleMonthlyDates)
233
+	{
234
+		$monthlyDates = explode(',', $scheduleMonthlyDates);
235
+		$monthlyDatesSize = sizeof($monthlyDates);
236 236
         
237
-        if ($monthlyDatesSize<1) {
238
-            return FALSE;
239
-        }
237
+		if ($monthlyDatesSize<1) {
238
+			return FALSE;
239
+		}
240 240
         
241
-        $isValid = TRUE;
241
+		$isValid = TRUE;
242 242
         
243
-        for ($i = 0; $i<$monthlyDatesSize; $i++) { 
244
-            if (is_numeric($monthlyDates[$i])) {
245
-                $mday = intval($monthlyDates[$i]);
246
-                if ($mday<1 || $mday>31) {
247
-                    $isValid = FALSE;
248
-                }
249
-            } else {
250
-                $isValid = FALSE;
251
-            }
252
-        }
243
+		for ($i = 0; $i<$monthlyDatesSize; $i++) { 
244
+			if (is_numeric($monthlyDates[$i])) {
245
+				$mday = intval($monthlyDates[$i]);
246
+				if ($mday<1 || $mday>31) {
247
+					$isValid = FALSE;
248
+				}
249
+			} else {
250
+				$isValid = FALSE;
251
+			}
252
+		}
253 253
 
254
-        return $isValid;
255
-    }
254
+		return $isValid;
255
+	}
256 256
     
257
-    public static function validateScheduleNthN($scheduleNthN)
258
-    {
259
-        if (!is_numeric($scheduleNthN)) {
260
-            return FALSE;
261
-        }
257
+	public static function validateScheduleNthN($scheduleNthN)
258
+	{
259
+		if (!is_numeric($scheduleNthN)) {
260
+			return FALSE;
261
+		}
262 262
         
263
-        $schedNthNs = array(1, 2, 3, 4, 5, -1);
263
+		$schedNthNs = array(1, 2, 3, 4, 5, -1);
264 264
         
265
-        if (in_array($scheduleNthN, $schedNthNs)) {
266
-            return TRUE;
267
-        } else {
268
-            return FALSE;
269
-        }
270
-    }
265
+		if (in_array($scheduleNthN, $schedNthNs)) {
266
+			return TRUE;
267
+		} else {
268
+			return FALSE;
269
+		}
270
+	}
271 271
     
272
-    public static function validateScheduleNthWhat($scheduleNthWhat)
273
-    {
274
-        if (!is_numeric($scheduleNthWhat)) {
275
-            return FALSE;
276
-        }
272
+	public static function validateScheduleNthWhat($scheduleNthWhat)
273
+	{
274
+		if (!is_numeric($scheduleNthWhat)) {
275
+			return FALSE;
276
+		}
277 277
         
278
-        $schedNthWhats = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
278
+		$schedNthWhats = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
279 279
         
280
-        if (in_array($scheduleNthWhat, $schedNthWhats)) {
281
-            return TRUE;
282
-        } else {
283
-            return FALSE;
284
-        }
285
-    }
280
+		if (in_array($scheduleNthWhat, $schedNthWhats)) {
281
+			return TRUE;
282
+		} else {
283
+			return FALSE;
284
+		}
285
+	}
286 286
     
287
-    /** Function adds the locations (with/without schedule) from the CSV file. 
288
-     * $csvFileHandle - a file handler.
289
-     * Returns array $results which contains two arrays: fail and succes.
290
-     */
291
-    public function addLocationsFromCsvFile($csvFileHandle, $locationsFieldsMapping)
292
-    {
293
-        $max_line_length = 512;
294
-        $delemietr = ',';
287
+	/** Function adds the locations (with/without schedule) from the CSV file. 
288
+	 * $csvFileHandle - a file handler.
289
+	 * Returns array $results which contains two arrays: fail and succes.
290
+	 */
291
+	public function addLocationsFromCsvFile($csvFileHandle, $locationsFieldsMapping)
292
+	{
293
+		$max_line_length = 512;
294
+		$delemietr = ',';
295 295
         
296
-        $results = array();
297
-        $results['fail'] = array();
298
-        $results['success'] = array();
296
+		$results = array();
297
+		$results['fail'] = array();
298
+		$results['success'] = array();
299 299
         
300
-        $columns = fgetcsv($csvFileHandle, $max_line_length, $delemietr);
300
+		$columns = fgetcsv($csvFileHandle, $max_line_length, $delemietr);
301 301
         
302
-        $addressBookFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('address_id', 'in_route_count'));
302
+		$addressBookFields = Route4Me::getObjectProperties(new AddressBookLocation(), array('address_id', 'in_route_count'));
303 303
 
304
-        if (empty($columns)) {
305
-            array_push($results['fail'], 'Empty CSV table');
306
-            return ($results);
307
-        }
304
+		if (empty($columns)) {
305
+			array_push($results['fail'], 'Empty CSV table');
306
+			return ($results);
307
+		}
308 308
 
309
-        $iRow = 1;
309
+		$iRow = 1;
310 310
         
311
-        while (($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))!==false) {
312
-            if (!isset($rows[$locationsFieldsMapping['cached_lat']]) || !isset($rows[$locationsFieldsMapping['cached_lng']]) 
313
-                  || !isset($rows[$locationsFieldsMapping['address_1']]) || array(null)==$rows) {
314
-                continue;
315
-            }
311
+		while (($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))!==false) {
312
+			if (!isset($rows[$locationsFieldsMapping['cached_lat']]) || !isset($rows[$locationsFieldsMapping['cached_lng']]) 
313
+				  || !isset($rows[$locationsFieldsMapping['address_1']]) || array(null)==$rows) {
314
+				continue;
315
+			}
316 316
                       
317
-            $curSchedule = "";
318
-            $mode = "";
317
+			$curSchedule = "";
318
+			$mode = "";
319 319
             
320
-            $failCount = sizeof($results['fail']); 
320
+			$failCount = sizeof($results['fail']); 
321 321
             
322
-            if (isset($rows[$locationsFieldsMapping['schedule_mode']])) {
323
-                if ($this->validateScheduleMode($rows[$locationsFieldsMapping['schedule_mode']])) {
324
-                    $curSchedule = '"mode":"'.$rows[$locationsFieldsMapping['schedule_mode']].'",'; 
325
-                    $mode = $rows[$locationsFieldsMapping['schedule_mode']];
326
-                } else {
327
-                    array_push($results['fail'], "$iRow --> Wrong schedule mode parameter"); 
328
-                }
329
-            } else {
330
-                array_push($results['fail'], "$iRow --> The schedule mode parameter is not set"); 
331
-            }
322
+			if (isset($rows[$locationsFieldsMapping['schedule_mode']])) {
323
+				if ($this->validateScheduleMode($rows[$locationsFieldsMapping['schedule_mode']])) {
324
+					$curSchedule = '"mode":"'.$rows[$locationsFieldsMapping['schedule_mode']].'",'; 
325
+					$mode = $rows[$locationsFieldsMapping['schedule_mode']];
326
+				} else {
327
+					array_push($results['fail'], "$iRow --> Wrong schedule mode parameter"); 
328
+				}
329
+			} else {
330
+				array_push($results['fail'], "$iRow --> The schedule mode parameter is not set"); 
331
+			}
332 332
             
333
-            if (isset($rows[$locationsFieldsMapping['schedule_enabled']])) {
334
-                if ($this->validateScheduleEnable($rows[$locationsFieldsMapping['schedule_enabled']])) { 
335
-                    $curSchedule .= '"enabled":'.$rows[$locationsFieldsMapping['schedule_enabled']].',';
336
-                } else {
337
-                    array_push($results['fail'], "$iRow --> The schedule enabled parameter is not set ");  
338
-                }
339
-            }
333
+			if (isset($rows[$locationsFieldsMapping['schedule_enabled']])) {
334
+				if ($this->validateScheduleEnable($rows[$locationsFieldsMapping['schedule_enabled']])) { 
335
+					$curSchedule .= '"enabled":'.$rows[$locationsFieldsMapping['schedule_enabled']].',';
336
+				} else {
337
+					array_push($results['fail'], "$iRow --> The schedule enabled parameter is not set ");  
338
+				}
339
+			}
340 340
             
341
-            if (isset($rows[$locationsFieldsMapping['schedule_every']])) {
342
-                if ($this->validateScheduleEvery($rows[$locationsFieldsMapping['schedule_every']])) {
343
-                    $curSchedule .= '"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; 
344
-                    if ($mode=='daily') {
345
-                        $curSchedule = trim($curSchedule, ',');
346
-                        $curSchedule .= '}';
347
-                    }
348
-                } else {
349
-                    array_push($results['fail'], "$iRow --> The parameter sched_every is not set"); 
350
-                }
351
-            }
341
+			if (isset($rows[$locationsFieldsMapping['schedule_every']])) {
342
+				if ($this->validateScheduleEvery($rows[$locationsFieldsMapping['schedule_every']])) {
343
+					$curSchedule .= '"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; 
344
+					if ($mode=='daily') {
345
+						$curSchedule = trim($curSchedule, ',');
346
+						$curSchedule .= '}';
347
+					}
348
+				} else {
349
+					array_push($results['fail'], "$iRow --> The parameter sched_every is not set"); 
350
+				}
351
+			}
352 352
             
353
-            if ($mode!='daily') {
354
-                switch ($mode) {
355
-                    case 'weekly':
356
-                        if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) {
357
-                            if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) {
358
-                                 $curSchedule .= '"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}';
359
-                            } else {
360
-                                array_push($results['fail'], "$iRow --> Wrong weekdays"); 
361
-                            }
362
-                        } else {
363
-                            array_push($results['fail'], "$iRow --> The parameters sched_weekdays is not set"); 
364
-                        }
365
-                        break;
366
-                    case 'monthly':
367
-                        $monthlyMode = "";
368
-                        if (isset($rows[$locationsFieldsMapping['monthly_mode']])) {
369
-                            if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) {
370
-                                 $monthlyMode = $rows[$locationsFieldsMapping['monthly_mode']];
371
-                                 $curSchedule .= '"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",';
372
-                            } else {
373
-                                array_push($results['fail'], "$iRow --> Wrong monthly mode"); 
374
-                            }
375
-                        } else {
376
-                            array_push($results['fail'], "$iRow --> The parameter sched_monthly_mode is not set"); 
377
-                        }
353
+			if ($mode!='daily') {
354
+				switch ($mode) {
355
+					case 'weekly':
356
+						if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) {
357
+							if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) {
358
+								 $curSchedule .= '"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}';
359
+							} else {
360
+								array_push($results['fail'], "$iRow --> Wrong weekdays"); 
361
+							}
362
+						} else {
363
+							array_push($results['fail'], "$iRow --> The parameters sched_weekdays is not set"); 
364
+						}
365
+						break;
366
+					case 'monthly':
367
+						$monthlyMode = "";
368
+						if (isset($rows[$locationsFieldsMapping['monthly_mode']])) {
369
+							if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) {
370
+								 $monthlyMode = $rows[$locationsFieldsMapping['monthly_mode']];
371
+								 $curSchedule .= '"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",';
372
+							} else {
373
+								array_push($results['fail'], "$iRow --> Wrong monthly mode"); 
374
+							}
375
+						} else {
376
+							array_push($results['fail'], "$iRow --> The parameter sched_monthly_mode is not set"); 
377
+						}
378 378
                         
379
-                        if ($monthlyMode!="") {
380
-                            switch ($monthlyMode) {
381
-                                case 'dates':
382
-                                    if (isset($rows[$locationsFieldsMapping['monthly_dates']])) {
383
-                                        if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) {
384
-                                             $curSchedule .= '"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}';
385
-                                        } else {
386
-                                            array_push($results['fail'], "$iRow --> Wrong monthly dates"); 
387
-                                        }
388
-                                    }
389
-                                    break;
390
-                                case 'nth':
391
-                                    if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) {
392
-                                        if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) {
393
-                                             $curSchedule .= '"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].',';
394
-                                        } else {
395
-                                            array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_n"); 
396
-                                        }
397
-                                    } else {
398
-                                        array_push($results['fail'], "$iRow --> The parameter sched_nth_n is not set"); 
399
-                                    }
379
+						if ($monthlyMode!="") {
380
+							switch ($monthlyMode) {
381
+								case 'dates':
382
+									if (isset($rows[$locationsFieldsMapping['monthly_dates']])) {
383
+										if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) {
384
+											 $curSchedule .= '"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}';
385
+										} else {
386
+											array_push($results['fail'], "$iRow --> Wrong monthly dates"); 
387
+										}
388
+									}
389
+									break;
390
+								case 'nth':
391
+									if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) {
392
+										if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) {
393
+											 $curSchedule .= '"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].',';
394
+										} else {
395
+											array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_n"); 
396
+										}
397
+									} else {
398
+										array_push($results['fail'], "$iRow --> The parameter sched_nth_n is not set"); 
399
+									}
400 400
                                     
401
-                                    if ($curSchedule!="") {
402
-                                        if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
403
-                                            if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
404
-                                                 $curSchedule .= '"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}';
405
-                                            } else {
406
-                                                array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_what"); 
407
-                                            }
408
-                                        } else {
409
-                                            array_push($results['fail'], "$iRow --> The parameter sched_nth_what is not set"); 
410
-                                        }
411
-                                    }
412
-                                    break;
413
-                            }
414
-                        }
415
-                        break;
416
-                    default:
417
-                        $curSchedule = "";
418
-                        break;
419
-                }
420
-            }
401
+									if ($curSchedule!="") {
402
+										if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
403
+											if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) {
404
+												 $curSchedule .= '"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}';
405
+											} else {
406
+												array_push($results['fail'], "$iRow --> Wrong parameter sched_nth_what"); 
407
+											}
408
+										} else {
409
+											array_push($results['fail'], "$iRow --> The parameter sched_nth_what is not set"); 
410
+										}
411
+									}
412
+									break;
413
+							}
414
+						}
415
+						break;
416
+					default:
417
+						$curSchedule = "";
418
+						break;
419
+				}
420
+			}
421 421
 
422
-            if (sizeof($results['fail'])>$failCount) {
423
-                $curSchedule = "";
424
-            }
422
+			if (sizeof($results['fail'])>$failCount) {
423
+				$curSchedule = "";
424
+			}
425 425
 
426
-            if (($mode=='daily' || $mode=='weekly' || $mode=='monthy') && $curSchedule=="") {
427
-                $iRow++; 
428
-                continue;
429
-            }
426
+			if (($mode=='daily' || $mode=='weekly' || $mode=='monthy') && $curSchedule=="") {
427
+				$iRow++; 
428
+				continue;
429
+			}
430 430
             
431
-            $curSchedule = strtolower($curSchedule);
431
+			$curSchedule = strtolower($curSchedule);
432 432
             
433
-            $curSchedule = '[{'.$curSchedule.'}]';
433
+			$curSchedule = '[{'.$curSchedule.'}]';
434 434
 
435
-            $oSchedule = json_decode($curSchedule, TRUE);
435
+			$oSchedule = json_decode($curSchedule, TRUE);
436 436
             
437
-            $parametersArray = array();
437
+			$parametersArray = array();
438 438
             
439
-            foreach ($addressBookFields as $addressBookField) {
440
-                if (isset($locationsFieldsMapping[$addressBookField])) {
441
-                    $parametersArray[$addressBookField] = $rows[$locationsFieldsMapping[$addressBookField]];
442
-                }
443
-            }
439
+			foreach ($addressBookFields as $addressBookField) {
440
+				if (isset($locationsFieldsMapping[$addressBookField])) {
441
+					$parametersArray[$addressBookField] = $rows[$locationsFieldsMapping[$addressBookField]];
442
+				}
443
+			}
444 444
             
445
-            $AdressBookLocationParameters = AddressBookLocation::fromArray($parametersArray);
445
+			$AdressBookLocationParameters = AddressBookLocation::fromArray($parametersArray);
446 446
             
447
-            $abContacts = new AddressBookLocation();
447
+			$abContacts = new AddressBookLocation();
448 448
 
449
-            $abcResults = $abContacts->addAdressBookLocation($AdressBookLocationParameters); //temporarry
449
+			$abcResults = $abContacts->addAdressBookLocation($AdressBookLocationParameters); //temporarry
450 450
             
451
-            array_push($results['success'], "The schedule location with address_id = ".strval($abcResults["address_id"])." added successfuly.");
452
-        }
451
+			array_push($results['success'], "The schedule location with address_id = ".strval($abcResults["address_id"])." added successfuly.");
452
+		}
453 453
 
454
-        return $results;
455
-    }
454
+		return $results;
455
+	}
456 456
  }
457 457
  
458 458
\ No newline at end of file
Please login to merge, or discard this patch.
examples/Members/webinar_registration.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@
 block discarded – undo
13 13
 Route4Me::setApiKey('11111111111111111111111111111111');
14 14
 
15 15
 $recordParameters = Member::fromArray(array(
16
-    'email_address' => '[email protected]',
17
-    'first_name'    => 'Mmmmm',
18
-    'last_name'     => 'Ccccc',
19
-    'phone_number'  => '454-454544',
20
-    'company_name'  => 'c_name',
21
-    'member_id'     => '123456',
22
-    'webinar_date'  => '2016-06-05 10:00:00'
16
+	'email_address' => '[email protected]',
17
+	'first_name'    => 'Mmmmm',
18
+	'last_name'     => 'Ccccc',
19
+	'phone_number'  => '454-454544',
20
+	'company_name'  => 'c_name',
21
+	'member_id'     => '123456',
22
+	'webinar_date'  => '2016-06-05 10:00:00'
23 23
 ));
24 24
 
25 25
 $member = new Member();
Please login to merge, or discard this patch.
examples/AddressBook/SearchTextSpecifiedFields.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
 // Example refers to the process of searching for text and specifing returned fields. 
18 18
 
19 19
 $params = array(
20
-    'query'   => 'David',
21
-    'fields'  => 'first_name,address_email',
22
-    'offset'  => 0,
23
-    'limit'   => 5
20
+	'query'   => 'David',
21
+	'fields'  => 'first_name,address_email',
22
+	'offset'  => 0,
23
+	'limit'   => 5
24 24
 );
25 25
 
26 26
 $abcResult = $ablocation->searchAddressBookLocations($params);
Please login to merge, or discard this patch.
examples/AddressBook/GetAddressBookLocationsByIDs.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 // Get two random locations IDs
14 14
 
15 15
 $adressBookLocationParameters = array(
16
-    "limit"   => 30,
17
-    "offset"  => 0
16
+	"limit"   => 30,
17
+	"offset"  => 0
18 18
 ); 
19 19
 
20 20
 $abContacts = new AddressBookLocation();
@@ -38,6 +38,6 @@  discard block
 block discarded – undo
38 38
 $results = $ablocation->getValue($abcResult, "results");
39 39
 
40 40
 foreach ($results as $result) {
41
-    Route4Me::simplePrint($result);
42
-    echo "<br>";
41
+	Route4Me::simplePrint($result);
42
+	echo "<br>";
43 43
 }
Please login to merge, or discard this patch.
examples/AddressBook/AddScheduledAddressBookLocation.php 1 patch
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@  discard block
 block discarded – undo
12 12
 
13 13
 #region // Add a location, scheduled daily with custom data.
14 14
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
15
-    "address_1"            => "1604 PARKRIDGE PKWY, Louisville, KY, 40214",
16
-    "address_alias"        => "1604 PARKRIDGE PKWY 40214",
17
-    "address_group"        => "Scheduled daily",
18
-    "first_name"           => "Peter",
19
-    "last_name"            => "Newman",
20
-    "address_email"        => "[email protected]",
21
-    "address_phone_number" => "65432178",
22
-    "cached_lat"           => 38.141598,
23
-    "cached_lng"           => -85.793846,
24
-    "address_city"         => "Louisville",
25
-    "address_custom_data"  => array("scheduled"   => "yes", 
26
-                                    "serice type" => "publishing"),
27
-    "schedule" => array(array(
28
-        "enabled" => true,
29
-        "mode"    => "daily",
30
-        "daily"   => array("every" => 1)
31
-    )),
32
-    "service_time" => 900
15
+	"address_1"            => "1604 PARKRIDGE PKWY, Louisville, KY, 40214",
16
+	"address_alias"        => "1604 PARKRIDGE PKWY 40214",
17
+	"address_group"        => "Scheduled daily",
18
+	"first_name"           => "Peter",
19
+	"last_name"            => "Newman",
20
+	"address_email"        => "[email protected]",
21
+	"address_phone_number" => "65432178",
22
+	"cached_lat"           => 38.141598,
23
+	"cached_lng"           => -85.793846,
24
+	"address_city"         => "Louisville",
25
+	"address_custom_data"  => array("scheduled"   => "yes", 
26
+									"serice type" => "publishing"),
27
+	"schedule" => array(array(
28
+		"enabled" => true,
29
+		"mode"    => "daily",
30
+		"daily"   => array("every" => 1)
31
+	)),
32
+	"service_time" => 900
33 33
 ));
34 34
 
35 35
 $abContacts1 = new AddressBookLocation();
@@ -44,27 +44,27 @@  discard block
 block discarded – undo
44 44
 
45 45
 #region // Add a location, scheduled weekly.
46 46
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
47
-    "address_1"            => "1407 MCCOY, Louisville, KY, 40215",
48
-    "address_alias"        => "1407 MCCOY 40215",
49
-    "address_group"        => "Scheduled weekly",
50
-    "first_name"           => "Bart",
51
-    "last_name"            => "Douglas",
52
-    "address_email"        => "[email protected]",
53
-    "address_phone_number" => "95487454",
54
-    "cached_lat"           => 38.202496,
55
-    "cached_lng"           => -85.786514,
56
-    "curbside_lat"         => 38.202496,
57
-    "curbside_lng"         => -85.786514,
58
-    "address_city"         => "Louisville",
59
-    "schedule" => array(array(
60
-        "enabled" => true,
61
-        "mode"    => "weekly",
62
-        "weekly"  => array(
63
-            "every"    => 1,
64
-            "weekdays" => array(1, 2, 3, 4, 5)
65
-        )
66
-    )),
67
-    "service_time" => 600
47
+	"address_1"            => "1407 MCCOY, Louisville, KY, 40215",
48
+	"address_alias"        => "1407 MCCOY 40215",
49
+	"address_group"        => "Scheduled weekly",
50
+	"first_name"           => "Bart",
51
+	"last_name"            => "Douglas",
52
+	"address_email"        => "[email protected]",
53
+	"address_phone_number" => "95487454",
54
+	"cached_lat"           => 38.202496,
55
+	"cached_lng"           => -85.786514,
56
+	"curbside_lat"         => 38.202496,
57
+	"curbside_lng"         => -85.786514,
58
+	"address_city"         => "Louisville",
59
+	"schedule" => array(array(
60
+		"enabled" => true,
61
+		"mode"    => "weekly",
62
+		"weekly"  => array(
63
+			"every"    => 1,
64
+			"weekdays" => array(1, 2, 3, 4, 5)
65
+		)
66
+	)),
67
+	"service_time" => 600
68 68
 ));
69 69
 
70 70
 $abContacts2 = new AddressBookLocation();
@@ -79,33 +79,33 @@  discard block
 block discarded – undo
79 79
 
80 80
 #region // Add a location, scheduled monthly (dates mode).
81 81
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
82
-    "address_1"            => "4805 BELLEVUE AVE, Louisville, KY, 40215",
83
-    "address_2"            => "4806 BELLEVUE AVE, Louisville, KY, 40215",
84
-    "address_alias"        => "4805 BELLEVUE AVE 40215",
85
-    "address_group"        => "Scheduled monthly",
86
-    "first_name"           => "Bart",
87
-    "last_name"            => "Douglas",
88
-    "address_email"        => "[email protected]",
89
-    "address_phone_number" => "95487454",
90
-    "cached_lat"           => 38.178844,
91
-    "cached_lng"           => -85.774864,
92
-    "curbside_lat"         => 38.178844,
93
-    "curbside_lng"         => -85.774864,
94
-    "address_city"         => "Louisville",
95
-    "address_country_id"   => "US",
96
-    "address_state_id"     => "KY",
97
-    "address_zip"          => "40215",
98
-    "schedule" => array(array(
99
-        "enabled" => true,
100
-        "mode"    => "monthly",
101
-        "monthly" => array(
102
-            "every" => 1,
103
-            "mode"  => "dates",
104
-            "dates" => array(20, 22, 23, 24, 25)
105
-        )
106
-    )),
107
-    "service_time" => 750,
108
-    "color" => "red"
82
+	"address_1"            => "4805 BELLEVUE AVE, Louisville, KY, 40215",
83
+	"address_2"            => "4806 BELLEVUE AVE, Louisville, KY, 40215",
84
+	"address_alias"        => "4805 BELLEVUE AVE 40215",
85
+	"address_group"        => "Scheduled monthly",
86
+	"first_name"           => "Bart",
87
+	"last_name"            => "Douglas",
88
+	"address_email"        => "[email protected]",
89
+	"address_phone_number" => "95487454",
90
+	"cached_lat"           => 38.178844,
91
+	"cached_lng"           => -85.774864,
92
+	"curbside_lat"         => 38.178844,
93
+	"curbside_lng"         => -85.774864,
94
+	"address_city"         => "Louisville",
95
+	"address_country_id"   => "US",
96
+	"address_state_id"     => "KY",
97
+	"address_zip"          => "40215",
98
+	"schedule" => array(array(
99
+		"enabled" => true,
100
+		"mode"    => "monthly",
101
+		"monthly" => array(
102
+			"every" => 1,
103
+			"mode"  => "dates",
104
+			"dates" => array(20, 22, 23, 24, 25)
105
+		)
106
+	)),
107
+	"service_time" => 750,
108
+	"color" => "red"
109 109
 ));
110 110
 
111 111
 $abContacts3 = new AddressBookLocation();
@@ -120,36 +120,36 @@  discard block
 block discarded – undo
120 120
 
121 121
 #region // AAdd a location, scheduled monthly (nth mode).
122 122
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
123
-    "address_1"            => "730 CECIL AVENUE, Louisville, KY, 40211",
124
-    "address_alias"        => "730 CECIL AVENUE 40211",
125
-    "address_group"        => "Scheduled monthly",
126
-    "first_name"           => "David",
127
-    "last_name"            => "Silvester",
128
-    "address_email"        => "[email protected]",
129
-    "address_phone_number" => "36985214",
130
-    "cached_lat"           => 38.248684,
131
-    "cached_lng"           => -85.821121,
132
-    "curbside_lat"         => 38.248684,
133
-    "curbside_lng"         => -85.821121,
134
-    "address_city"         => "Louisville",
135
-    "address_custom_data" => array(
136
-        "scheduled"    => "yes",
137
-        "service type" => "library"
138
-    ),
139
-    "schedule" => array(array(
140
-        "enabled" => true,
141
-        "mode"    => "monthly",
142
-        "monthly" => array(
143
-            "every" => 1,
144
-            "mode"  => "nth",
145
-            "nth"   => array(
146
-                "n"    => 1,
147
-                "what" => 4
148
-            )
149
-        )
150
-    )),
151
-    "service_time" => 450,
152
-    "address_icon" => "emoji/emoji-bus"
123
+	"address_1"            => "730 CECIL AVENUE, Louisville, KY, 40211",
124
+	"address_alias"        => "730 CECIL AVENUE 40211",
125
+	"address_group"        => "Scheduled monthly",
126
+	"first_name"           => "David",
127
+	"last_name"            => "Silvester",
128
+	"address_email"        => "[email protected]",
129
+	"address_phone_number" => "36985214",
130
+	"cached_lat"           => 38.248684,
131
+	"cached_lng"           => -85.821121,
132
+	"curbside_lat"         => 38.248684,
133
+	"curbside_lng"         => -85.821121,
134
+	"address_city"         => "Louisville",
135
+	"address_custom_data" => array(
136
+		"scheduled"    => "yes",
137
+		"service type" => "library"
138
+	),
139
+	"schedule" => array(array(
140
+		"enabled" => true,
141
+		"mode"    => "monthly",
142
+		"monthly" => array(
143
+			"every" => 1,
144
+			"mode"  => "nth",
145
+			"nth"   => array(
146
+				"n"    => 1,
147
+				"what" => 4
148
+			)
149
+		)
150
+	)),
151
+	"service_time" => 450,
152
+	"address_icon" => "emoji/emoji-bus"
153 153
 ));
154 154
 
155 155
 $abContacts4 = new AddressBookLocation();
@@ -165,29 +165,29 @@  discard block
 block discarded – undo
165 165
 #region // Add a location with the daily scheduling and blacklist.
166 166
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
167 167
 
168
-    "address_1"            => "4629 HILLSIDE DRIVE, Louisville, KY, 40216",
169
-    "address_alias"        => "4629 HILLSIDE DRIVE 40216",
170
-    "address_group"        => "Scheduled daily",
171
-    "first_name"           => "Kim",
172
-    "last_name"            => "Shandor",
173
-    "address_email"        => "[email protected]",
174
-    "address_phone_number" => "9874152",
175
-    "cached_lat"           => 38.176067,
176
-    "cached_lng"           => -85.824638,
177
-    "curbside_lat"         => 38.176067,
178
-    "curbside_lng"         => -85.824638,
179
-    "address_city"         => "Louisville",
180
-    "address_custom_data"  => array(
181
-        "scheduled"   => "yes",
182
-        "serice type" => "appliance"
183
-    ),
184
-    "schedule" => array(
185
-        "enabled" => true,
186
-        "mode"    => "daily",
187
-        "daily"   => array("every" => 1)
188
-    ),
189
-    "schedule_blacklist" => array("2017-02-24", "2017-02-25"),
190
-    "service_time"       => 300
168
+	"address_1"            => "4629 HILLSIDE DRIVE, Louisville, KY, 40216",
169
+	"address_alias"        => "4629 HILLSIDE DRIVE 40216",
170
+	"address_group"        => "Scheduled daily",
171
+	"first_name"           => "Kim",
172
+	"last_name"            => "Shandor",
173
+	"address_email"        => "[email protected]",
174
+	"address_phone_number" => "9874152",
175
+	"cached_lat"           => 38.176067,
176
+	"cached_lng"           => -85.824638,
177
+	"curbside_lat"         => 38.176067,
178
+	"curbside_lng"         => -85.824638,
179
+	"address_city"         => "Louisville",
180
+	"address_custom_data"  => array(
181
+		"scheduled"   => "yes",
182
+		"serice type" => "appliance"
183
+	),
184
+	"schedule" => array(
185
+		"enabled" => true,
186
+		"mode"    => "daily",
187
+		"daily"   => array("every" => 1)
188
+	),
189
+	"schedule_blacklist" => array("2017-02-24", "2017-02-25"),
190
+	"service_time"       => 300
191 191
 ));
192 192
 
193 193
 $abContacts5 = new AddressBookLocation();
Please login to merge, or discard this patch.
examples/AddressBook/AddAddressBookLocation.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 Route4Me::setApiKey('11111111111111111111111111111111');
12 12
 
13 13
 $AdressBookLocationParameters = AddressBookLocation::fromArray(array(
14
-    "first_name"  => "Test FirstName ".strval(rand(10000, 99999)),
15
-    "address_1"   => "Test Address1 ".strval(rand(10000, 99999)),
16
-    "cached_lat"  => 38.024654,
17
-    "cached_lng"  => -77.338814
14
+	"first_name"  => "Test FirstName ".strval(rand(10000, 99999)),
15
+	"address_1"   => "Test Address1 ".strval(rand(10000, 99999)),
16
+	"cached_lat"  => 38.024654,
17
+	"cached_lng"  => -77.338814
18 18
 ));
19 19
 
20 20
 $abContacts = new AddressBookLocation();
Please login to merge, or discard this patch.
examples/Activities/GetRouteTeamActivities.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 assert(!is_null($routeId), "Can't retrieve random route_id");
21 21
 
22 22
 $activityParameters = ActivityParameters::fromArray(array(
23
-    "route_id"   => $routeId,
24
-    "team"       => "true"
23
+	"route_id"   => $routeId,
24
+	"team"       => "true"
25 25
 ));
26 26
 
27 27
 $activities = new ActivityParameters();
@@ -30,5 +30,5 @@  discard block
 block discarded – undo
30 30
 
31 31
 foreach ($results as $result) {
32 32
 	Route4Me::simplePrint($result);
33
-    echo "<br>";
33
+	echo "<br>";
34 34
 }
Please login to merge, or discard this patch.
examples/Addresses/mark_address_as_departed.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
 $address = new Address();
30 30
 
31 31
 $params = array(
32
-    "route_id"     => $routeId,
33
-    "address_id"   => $route_destination_id,
34
-    "is_departed"  => 1,
35
-    "member_id"    => 1
32
+	"route_id"     => $routeId,
33
+	"address_id"   => $route_destination_id,
34
+	"is_departed"  => 1,
35
+	"member_id"    => 1
36 36
 );
37 37
 
38 38
 $result = $address->markAsDeparted($params);
Please login to merge, or discard this patch.