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 ( ba89cf...799599 )
by Oleg
02:27
created
src/Route4Me/Enum/OptimizationStates.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 
4 4
 class OptimizationStates
5 5
 {
6
-    const INITIAL              = 1;
7
-    const MATRIX_PROCESSING    = 2;
8
-    const OPTIMIZING           = 3;
9
-    const OPTIMIZED            = 4;
10
-    const ERROR                = 5;
11
-    const COMPUTING_DIRECTIONS = 6;
6
+	const INITIAL              = 1;
7
+	const MATRIX_PROCESSING    = 2;
8
+	const OPTIMIZING           = 3;
9
+	const OPTIMIZED            = 4;
10
+	const ERROR                = 5;
11
+	const COMPUTING_DIRECTIONS = 6;
12 12
 }
Please login to merge, or discard this patch.
src/Route4Me/Enum/TerritoryTypes.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 class TerritoryTypes
5 5
 {
6
-    const CIRCLE = 'circle';
7
-    const POLY   = 'poly';
8
-    const RECT   = 'rect';
6
+	const CIRCLE = 'circle';
7
+	const POLY   = 'poly';
8
+	const RECT   = 'rect';
9 9
 }
Please login to merge, or discard this patch.
src/Route4Me/Enum/AlgorithmType.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@
 block discarded – undo
3 3
 
4 4
 class AlgorithmType
5 5
 {
6
-    const TSP = 1;
7
-    const VRP = 2;
8
-    const CVRP_TW_SD = 3;
9
-    const CVRP_TW_MD = 4;
10
-    const TSP_TW = 5;
11
-    const TSP_TW_CR = 6;
12
-    const BBCVRP = 7;
13
-    const ALG_NONE  =  100;
14
-    const ALG_LEGACY_DISTRIBUTED = 101;
6
+	const TSP = 1;
7
+	const VRP = 2;
8
+	const CVRP_TW_SD = 3;
9
+	const CVRP_TW_MD = 4;
10
+	const TSP_TW = 5;
11
+	const TSP_TW_CR = 6;
12
+	const BBCVRP = 7;
13
+	const ALG_NONE  =  100;
14
+	const ALG_LEGACY_DISTRIBUTED = 101;
15 15
 }
Please login to merge, or discard this patch.
src/Route4Me/Vehicle.php 1 patch
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -6,179 +6,179 @@
 block discarded – undo
6 6
 
7 7
 class Vehicle extends Common
8 8
 {
9
-    public $vehicle_id;
10
-    public $member_id;
11
-    public $is_deleted;
12
-    public $vehicle_alias;
13
-    public $vehicle_vin;
14
-    public $vehicle_reg_state_id;
15
-    public $vehicle_reg_country_id;
16
-    public $vehicle_license_plate;
17
-    public $vehicle_type_id;
18
-    public $vehicle_make;
19
-    public $vehicle_model_year;
20
-    public $vehicle_model;
21
-    public $vehicle_year_acquired;
22
-    public $vehicle_cost_new;
23
-    public $purchased_new;
24
-    public $license_start_date;
25
-    public $license_end_date;
26
-    public $vehicle_axle_count;
27
-    public $is_operational;
28
-    public $mpg_city;
29
-    public $mpg_highway;
30
-    public $fuel_type;
31
-    public $height_inches;
32
-    public $weight_lb;
33
-    public $external_telematics_vehicle_id;
34
-    public $has_trailer;
35
-    public $heightInInches;
36
-    public $lengthInInches;
37
-    public $widthInInches;
38
-    public $maxWeightPerAxleGroupInPounds;
39
-    public $numAxles;
40
-    public $weightInPounds;
41
-    public $HazmatType;
42
-    public $LowEmissionZonePref;
43
-    public $Use53FootTrailerRouting;
44
-    public $UseNationalNetwork;
45
-    public $UseTruckRestrictions;
46
-    public $AvoidFerries;
47
-    public $DividedHighwayAvoidPreference;
48
-    public $FreewayAvoidPreference;
49
-    public $InternationalBordersOpen;
50
-    public $TollRoadUsage;
51
-    public $hwy_only;
52
-    public $long_combination_vehicle;
53
-    public $avoid_highways;
54
-    public $side_street_adherence;
55
-    public $truck_config;
56
-    public $height_metric;
57
-    public $length_metric;
58
-    public $width_metric;
59
-    public $weight_metric;
60
-    public $max_weight_per_axle_group_metric;
9
+	public $vehicle_id;
10
+	public $member_id;
11
+	public $is_deleted;
12
+	public $vehicle_alias;
13
+	public $vehicle_vin;
14
+	public $vehicle_reg_state_id;
15
+	public $vehicle_reg_country_id;
16
+	public $vehicle_license_plate;
17
+	public $vehicle_type_id;
18
+	public $vehicle_make;
19
+	public $vehicle_model_year;
20
+	public $vehicle_model;
21
+	public $vehicle_year_acquired;
22
+	public $vehicle_cost_new;
23
+	public $purchased_new;
24
+	public $license_start_date;
25
+	public $license_end_date;
26
+	public $vehicle_axle_count;
27
+	public $is_operational;
28
+	public $mpg_city;
29
+	public $mpg_highway;
30
+	public $fuel_type;
31
+	public $height_inches;
32
+	public $weight_lb;
33
+	public $external_telematics_vehicle_id;
34
+	public $has_trailer;
35
+	public $heightInInches;
36
+	public $lengthInInches;
37
+	public $widthInInches;
38
+	public $maxWeightPerAxleGroupInPounds;
39
+	public $numAxles;
40
+	public $weightInPounds;
41
+	public $HazmatType;
42
+	public $LowEmissionZonePref;
43
+	public $Use53FootTrailerRouting;
44
+	public $UseNationalNetwork;
45
+	public $UseTruckRestrictions;
46
+	public $AvoidFerries;
47
+	public $DividedHighwayAvoidPreference;
48
+	public $FreewayAvoidPreference;
49
+	public $InternationalBordersOpen;
50
+	public $TollRoadUsage;
51
+	public $hwy_only;
52
+	public $long_combination_vehicle;
53
+	public $avoid_highways;
54
+	public $side_street_adherence;
55
+	public $truck_config;
56
+	public $height_metric;
57
+	public $length_metric;
58
+	public $width_metric;
59
+	public $weight_metric;
60
+	public $max_weight_per_axle_group_metric;
61 61
     
62
-    public function __construct () 
63
-    {
64
-        Route4Me::setBaseUrl(Endpoint::WH_BASE_URL);
65
-    }
62
+	public function __construct () 
63
+	{
64
+		Route4Me::setBaseUrl(Endpoint::WH_BASE_URL);
65
+	}
66 66
     
67
-    public static function fromArray(array $params) {
68
-        $vehicle= new Vehicle();
69
-        foreach($params as $key => $value) {
70
-            if (property_exists($vehicle, $key)) {
71
-                $vehicle->{$key} = $value;
72
-            }
73
-        }
67
+	public static function fromArray(array $params) {
68
+		$vehicle= new Vehicle();
69
+		foreach($params as $key => $value) {
70
+			if (property_exists($vehicle, $key)) {
71
+				$vehicle->{$key} = $value;
72
+			}
73
+		}
74 74
         
75
-        return $vehicle;
76
-    }
75
+		return $vehicle;
76
+	}
77 77
     
78
-    public static function getVehicles($params)
79
-    {
80
-        $response = Route4Me::makeRequst(array(
81
-            'url'    => Endpoint::VEHICLE_V4,
82
-            'method' => 'GET',
83
-            'query'  => array(
84
-                'with_pagination'  => isset($params['with_pagination']) ? $params['with_pagination'] : null,
85
-                'page'             => isset($params['page']) ? $params['page'] : null,
86
-                'perPage'          => isset($params['perPage']) ? $params['perPage'] : null,
87
-            )
88
-        ));
78
+	public static function getVehicles($params)
79
+	{
80
+		$response = Route4Me::makeRequst(array(
81
+			'url'    => Endpoint::VEHICLE_V4,
82
+			'method' => 'GET',
83
+			'query'  => array(
84
+				'with_pagination'  => isset($params['with_pagination']) ? $params['with_pagination'] : null,
85
+				'page'             => isset($params['page']) ? $params['page'] : null,
86
+				'perPage'          => isset($params['perPage']) ? $params['perPage'] : null,
87
+			)
88
+		));
89 89
 
90
-        return $response;
91
-    }
90
+		return $response;
91
+	}
92 92
     
93
-    public function getRandomVehicleId($page,$perPage)
94
-    {
95
-        $query['page'] = isset($page) ? $page : 1;
96
-        $query['perPage'] = isset($perPage) ? $perPage : 10;
97
-        $query['with_pagination'] = true;
93
+	public function getRandomVehicleId($page,$perPage)
94
+	{
95
+		$query['page'] = isset($page) ? $page : 1;
96
+		$query['perPage'] = isset($perPage) ? $perPage : 10;
97
+		$query['with_pagination'] = true;
98 98
         
99
-        $vehicles = $this->getVehicles($query);
99
+		$vehicles = $this->getVehicles($query);
100 100
 
101
-        if (is_null($vehicles)) return null;
102
-        if (!isset($vehicles['data'])) return null;
103
-        if (sizeof($vehicles['data'])<1) return null;
101
+		if (is_null($vehicles)) return null;
102
+		if (!isset($vehicles['data'])) return null;
103
+		if (sizeof($vehicles['data'])<1) return null;
104 104
         
105
-        $randomIndex = rand(0, sizeof($vehicles['data'])-1);
105
+		$randomIndex = rand(0, sizeof($vehicles['data'])-1);
106 106
         
107
-        return $vehicles['data'][$randomIndex]['vehicle_id'];
108
-    }
107
+		return $vehicles['data'][$randomIndex]['vehicle_id'];
108
+	}
109 109
     
110
-    public function getVehicleByID($vehicleID)
111
-    {
112
-        $response = Route4Me::makeRequst(array(
113
-            'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
114
-            'method' => 'GET'
115
-        ));
110
+	public function getVehicleByID($vehicleID)
111
+	{
112
+		$response = Route4Me::makeRequst(array(
113
+			'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
114
+			'method' => 'GET'
115
+		));
116 116
 
117
-        return $response;
118
-    }
117
+		return $response;
118
+	}
119 119
     
120
-    public function updateVehicle($params)
121
-    {
122
-        $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null;
120
+	public function updateVehicle($params)
121
+	{
122
+		$vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null;
123 123
         
124
-        $body = array();
124
+		$body = array();
125 125
         
126
-        $vehicle= new Vehicle();
126
+		$vehicle= new Vehicle();
127 127
         
128
-        foreach($params as $key => $value) {
129
-            if ($key=="vehicle_id") continue; 
130
-            if (property_exists($vehicle, $key)) {
131
-                if (isset($params->{$key})) {
132
-                    $body[$key] = $params->{$key};
133
-                } 
134
-            }
135
-        }
128
+		foreach($params as $key => $value) {
129
+			if ($key=="vehicle_id") continue; 
130
+			if (property_exists($vehicle, $key)) {
131
+				if (isset($params->{$key})) {
132
+					$body[$key] = $params->{$key};
133
+				} 
134
+			}
135
+		}
136 136
         
137
-        $response = Route4Me::makeRequst(array(
138
-            'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
139
-            'method' => 'PUT',
140
-            'body'   => $body,
141
-            'HTTPHEADER'  => 'Content-Type: application/json'
142
-        ));
137
+		$response = Route4Me::makeRequst(array(
138
+			'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
139
+			'method' => 'PUT',
140
+			'body'   => $body,
141
+			'HTTPHEADER'  => 'Content-Type: application/json'
142
+		));
143 143
 
144
-        return $response;
145
-    }
144
+		return $response;
145
+	}
146 146
     
147
-    public function createVehicle($params)
148
-    {
149
-        $body = array();
147
+	public function createVehicle($params)
148
+	{
149
+		$body = array();
150 150
         
151
-        $vehicle= new Vehicle();
151
+		$vehicle= new Vehicle();
152 152
         
153
-        foreach($params as $key => $value) {
154
-            if ($key=="vehicle_id") continue; 
155
-            if (property_exists($vehicle, $key)) {
156
-                if (isset($params->{$key})) {
157
-                    $body[$key] = $params->{$key};
158
-                } 
159
-            }
160
-        }
153
+		foreach($params as $key => $value) {
154
+			if ($key=="vehicle_id") continue; 
155
+			if (property_exists($vehicle, $key)) {
156
+				if (isset($params->{$key})) {
157
+					$body[$key] = $params->{$key};
158
+				} 
159
+			}
160
+		}
161 161
         
162
-        $response = Route4Me::makeRequst(array(
163
-            'url'    => Endpoint::VEHICLE_V4,
164
-            'method' => 'POST',
165
-            'body'   => $body,
166
-            'HTTPHEADER'  => 'Content-Type: application/json'
167
-        ));
162
+		$response = Route4Me::makeRequst(array(
163
+			'url'    => Endpoint::VEHICLE_V4,
164
+			'method' => 'POST',
165
+			'body'   => $body,
166
+			'HTTPHEADER'  => 'Content-Type: application/json'
167
+		));
168 168
 
169
-        return $response;
170
-    }
169
+		return $response;
170
+	}
171 171
     
172
-    public function removeVehicle($params)
173
-    {
174
-        $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null;
172
+	public function removeVehicle($params)
173
+	{
174
+		$vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null;
175 175
         
176
-        $response = Route4Me::makeRequst(array(
177
-            'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
178
-            'method' => 'DELETE',
179
-            'HTTPHEADER'  => 'Content-Type: application/json'
180
-        ));
176
+		$response = Route4Me::makeRequst(array(
177
+			'url'    => Endpoint::VEHICLE_V4 . '/' . $vehicleID,
178
+			'method' => 'DELETE',
179
+			'HTTPHEADER'  => 'Content-Type: application/json'
180
+		));
181 181
 
182
-        return $response;
183
-    }
182
+		return $response;
183
+	}
184 184
 }
Please login to merge, or discard this patch.
src/Route4Me/Member.php 1 patch
Indentation   +320 added lines, -320 removed lines patch added patch discarded remove patch
@@ -6,378 +6,378 @@
 block discarded – undo
6 6
 
7 7
 class Member extends Common
8 8
 {
9
-    public $device_id;
10
-    public $device_type;
11
-    public $format;
9
+	public $device_id;
10
+	public $device_type;
11
+	public $format;
12 12
     
13
-    public $strEmail;
14
-    public $strPassword;
15
-    public $strPassword_1;
16
-    public $strPassword_2;
17
-    public $strFirstName;
18
-    public $strLastName;
19
-    public $strIndustry;
20
-    public $chkTerms;
21
-    public $plan;
13
+	public $strEmail;
14
+	public $strPassword;
15
+	public $strPassword_1;
16
+	public $strPassword_2;
17
+	public $strFirstName;
18
+	public $strLastName;
19
+	public $strIndustry;
20
+	public $chkTerms;
21
+	public $plan;
22 22
     
23
-    public $session_guid;
24
-    public $member_id;
23
+	public $session_guid;
24
+	public $member_id;
25 25
     
26
-    public $email_address;
27
-    public $first_name;
28
-    public $last_name;
29
-    public $phone_number;
30
-    public $company_name;
31
-    public $webiinar_date;
26
+	public $email_address;
27
+	public $first_name;
28
+	public $last_name;
29
+	public $phone_number;
30
+	public $company_name;
31
+	public $webiinar_date;
32 32
     
33
-    public $subscription_name;
34
-    public $token;
35
-    public $payload;
33
+	public $subscription_name;
34
+	public $token;
35
+	public $payload;
36 36
     
37
-    public $HIDE_ROUTED_ADDRESSES;
38
-    public $member_phone;
39
-    public $member_zipcode;
40
-    public $route_count;
41
-    public $member_email;
42
-    public $HIDE_VISITED_ADDRESSES;
43
-    public $READONLY_USER;
44
-    public $member_type;
45
-    public $date_of_birth;
46
-    public $member_first_name;
47
-    public $member_password;
48
-    public $HIDE_NONFUTURE_ROUTES;
49
-    public $member_last_name;
50
-    public $SHOW_ALL_VEHICLES;
51
-    public $SHOW_ALL_DRIVERS;
37
+	public $HIDE_ROUTED_ADDRESSES;
38
+	public $member_phone;
39
+	public $member_zipcode;
40
+	public $route_count;
41
+	public $member_email;
42
+	public $HIDE_VISITED_ADDRESSES;
43
+	public $READONLY_USER;
44
+	public $member_type;
45
+	public $date_of_birth;
46
+	public $member_first_name;
47
+	public $member_password;
48
+	public $HIDE_NONFUTURE_ROUTES;
49
+	public $member_last_name;
50
+	public $SHOW_ALL_VEHICLES;
51
+	public $SHOW_ALL_DRIVERS;
52 52
     
53
-    public $config_key;
54
-    public $config_value;
53
+	public $config_key;
54
+	public $config_value;
55 55
     
56
-    public $preferred_units;
57
-    public $preferred_language;
58
-    public $timezone;
59
-    public $OWNER_MEMBER_ID;
60
-    public $user_reg_state_id;
61
-    public $user_reg_country_id;
62
-    public $member_picture;
63
-    public $api_key;
64
-    public $custom_data;
56
+	public $preferred_units;
57
+	public $preferred_language;
58
+	public $timezone;
59
+	public $OWNER_MEMBER_ID;
60
+	public $user_reg_state_id;
61
+	public $user_reg_country_id;
62
+	public $member_picture;
63
+	public $api_key;
64
+	public $custom_data;
65 65
     
66
-    public static function fromArray(array $params) 
67
-    {
68
-        $member= new Member();
66
+	public static function fromArray(array $params) 
67
+	{
68
+		$member= new Member();
69 69
         
70
-        foreach($params as $key => $value) {
71
-            if (property_exists($member, $key)) {
72
-                $member->{$key} = $value;
73
-            }
74
-        }
70
+		foreach($params as $key => $value) {
71
+			if (property_exists($member, $key)) {
72
+				$member->{$key} = $value;
73
+			}
74
+		}
75 75
         
76
-        return $member;
77
-    }
76
+		return $member;
77
+	}
78 78
     
79
-    public static function getUsers()
80
-    {
81
-        $response = Route4Me::makeRequst(array(
82
-            'url'    => Endpoint::USER_V4,
83
-            'method' => 'GET'
84
-        ));
79
+	public static function getUsers()
80
+	{
81
+		$response = Route4Me::makeRequst(array(
82
+			'url'    => Endpoint::USER_V4,
83
+			'method' => 'GET'
84
+		));
85 85
 
86
-        return $response;
87
-    }
86
+		return $response;
87
+	}
88 88
     
89
-    public static function getUser($params)
90
-    {
91
-        $response = Route4Me::makeRequst(array(
92
-            'url'    => Endpoint::USER_V4,
93
-            'method' => 'GET',
94
-            'query'  => array(
95
-                'member_id' => isset($params['member_id']) ? $params['member_id'] : null
96
-            )
97
-        ));
89
+	public static function getUser($params)
90
+	{
91
+		$response = Route4Me::makeRequst(array(
92
+			'url'    => Endpoint::USER_V4,
93
+			'method' => 'GET',
94
+			'query'  => array(
95
+				'member_id' => isset($params['member_id']) ? $params['member_id'] : null
96
+			)
97
+		));
98 98
 
99
-        return $response;
100
-    }
99
+		return $response;
100
+	}
101 101
     
102
-    public static function getUserLocations($param)
103
-    {
104
-        $response = Route4Me::makeRequst(array(
105
-            'url'    => Endpoint::VIEW_USER_LOCATIONS,
106
-            'method' => 'GET',
107
-            'query'  => array(
108
-                'query' => $param
109
-            )
110
-        ));
102
+	public static function getUserLocations($param)
103
+	{
104
+		$response = Route4Me::makeRequst(array(
105
+			'url'    => Endpoint::VIEW_USER_LOCATIONS,
106
+			'method' => 'GET',
107
+			'query'  => array(
108
+				'query' => $param
109
+			)
110
+		));
111 111
 
112
-        return $response;
113
-    }
112
+		return $response;
113
+	}
114 114
     
115
-    public static function addDeviceRecord($body)
116
-    {
117
-        $response = Route4Me::makeRequst(array(
118
-            'url'    => Endpoint::VERIFY_DEVICE_LICENSE,
119
-            'method' => 'POST',
120
-            'query'  => array(
121
-                'device_id'   => isset($body->device_id)   ? $body->device_id : null,
122
-                'device_type' => isset($body->device_type) ? $body->device_type : null,
123
-            ),
124
-            'body'   => array(
125
-                'device_id'   => isset($body->device_id)   ? $body->device_id : null,
126
-                'device_type' => isset($body->device_type) ? $body->device_type : null,
127
-                'format'      => isset($body->format)      ? $body->format : null
128
-            )
115
+	public static function addDeviceRecord($body)
116
+	{
117
+		$response = Route4Me::makeRequst(array(
118
+			'url'    => Endpoint::VERIFY_DEVICE_LICENSE,
119
+			'method' => 'POST',
120
+			'query'  => array(
121
+				'device_id'   => isset($body->device_id)   ? $body->device_id : null,
122
+				'device_type' => isset($body->device_type) ? $body->device_type : null,
123
+			),
124
+			'body'   => array(
125
+				'device_id'   => isset($body->device_id)   ? $body->device_id : null,
126
+				'device_type' => isset($body->device_type) ? $body->device_type : null,
127
+				'format'      => isset($body->format)      ? $body->format : null
128
+			)
129 129
 
130
-        ));
130
+		));
131 131
         
132
-        return $response;
133
-    }
132
+		return $response;
133
+	}
134 134
     
135
-    public static function createMember($body)
136
-    {
137
-        $response = Route4Me::makeRequst(array(
138
-            'url'    => Endpoint::USER_V4,
139
-            'method' => 'POST',
140
-            'body'   => array(
141
-                'HIDE_ROUTED_ADDRESSES'  => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null,
142
-                'member_phone'           => isset($body->member_phone) ? $body->member_phone : null,
143
-                'member_zipcode'         => isset($body->member_zipcode) ? $body->member_zipcode : null,
144
-                'route_count'            => isset($body->route_count) ? $body->route_count : null,
145
-                'member_email'           => isset($body->member_email) ? $body->member_email : null,
146
-                'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null,
147
-                'READONLY_USER'          => isset($body->READONLY_USER) ? $body->READONLY_USER : null,
148
-                'member_type'            => isset($body->member_type) ? $body->member_type : null,
149
-                'date_of_birth'          => isset($body->date_of_birth) ? $body->date_of_birth : null,
150
-                'member_first_name'      => isset($body->member_first_name) ? $body->member_first_name : null,
151
-                'member_password'        => isset($body->member_password) ? $body->member_password : null,
152
-                'HIDE_NONFUTURE_ROUTES'  => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null,
153
-                'member_last_name'       => isset($body->member_last_name) ? $body->member_last_name : null,
154
-                'SHOW_ALL_VEHICLES'      => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null,
155
-                'SHOW_ALL_DRIVERS'       => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null
156
-            )
157
-        ));
135
+	public static function createMember($body)
136
+	{
137
+		$response = Route4Me::makeRequst(array(
138
+			'url'    => Endpoint::USER_V4,
139
+			'method' => 'POST',
140
+			'body'   => array(
141
+				'HIDE_ROUTED_ADDRESSES'  => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null,
142
+				'member_phone'           => isset($body->member_phone) ? $body->member_phone : null,
143
+				'member_zipcode'         => isset($body->member_zipcode) ? $body->member_zipcode : null,
144
+				'route_count'            => isset($body->route_count) ? $body->route_count : null,
145
+				'member_email'           => isset($body->member_email) ? $body->member_email : null,
146
+				'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null,
147
+				'READONLY_USER'          => isset($body->READONLY_USER) ? $body->READONLY_USER : null,
148
+				'member_type'            => isset($body->member_type) ? $body->member_type : null,
149
+				'date_of_birth'          => isset($body->date_of_birth) ? $body->date_of_birth : null,
150
+				'member_first_name'      => isset($body->member_first_name) ? $body->member_first_name : null,
151
+				'member_password'        => isset($body->member_password) ? $body->member_password : null,
152
+				'HIDE_NONFUTURE_ROUTES'  => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null,
153
+				'member_last_name'       => isset($body->member_last_name) ? $body->member_last_name : null,
154
+				'SHOW_ALL_VEHICLES'      => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null,
155
+				'SHOW_ALL_DRIVERS'       => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null
156
+			)
157
+		));
158 158
         
159
-        return $response;
160
-    }
159
+		return $response;
160
+	}
161 161
 
162
-    public static function getRandomMemberByType($memberType)
163
-    {
164
-        $members = self::getUsers();
162
+	public static function getRandomMemberByType($memberType)
163
+	{
164
+		$members = self::getUsers();
165 165
         
166
-        if (is_null($members)) return null;
167
-        if (!isset($members['results'])) return null;
166
+		if (is_null($members)) return null;
167
+		if (!isset($members['results'])) return null;
168 168
         
169
-        $memberIDs = array();
169
+		$memberIDs = array();
170 170
         
171
-        foreach ($members['results'] as $memb) {
172
-            if (isset($memb['member_id']) && isset($memb['member_type'])) {
173
-                if ($memberType==$memb['member_type']) $memberIDs[]=$memb['member_id'];
174
-            }
175
-        }
171
+		foreach ($members['results'] as $memb) {
172
+			if (isset($memb['member_id']) && isset($memb['member_type'])) {
173
+				if ($memberType==$memb['member_type']) $memberIDs[]=$memb['member_id'];
174
+			}
175
+		}
176 176
         
177
-        if (sizeof($memberIDs)<1) return null;
177
+		if (sizeof($memberIDs)<1) return null;
178 178
         
179
-        $randomIndex = rand(0, sizeof($memberIDs)-1);
179
+		$randomIndex = rand(0, sizeof($memberIDs)-1);
180 180
         
181
-        return $memberIDs[$randomIndex];
182
-    }
181
+		return $memberIDs[$randomIndex];
182
+	}
183 183
 
184 184
 
185
-    public static function updateMember($body)
186
-    {
187
-        $response = Route4Me::makeRequst(array(
188
-            'url'    => Endpoint::USER_V4,
189
-            'method' => 'PUT',
190
-            'body'   => array(
191
-                'member_id'              => isset($body->member_id) ? $body->member_id : null,
192
-                'member_phone'           => isset($body->member_phone) ? $body->member_phone : null,
193
-                'HIDE_ROUTED_ADDRESSES'  => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null,
194
-                'member_zipcode'         => isset($body->member_zipcode) ? $body->member_zipcode : null,
195
-                'route_count'            => isset($body->route_count) ? $body->route_count : null,
196
-                'member_email'           => isset($body->member_email) ? $body->member_email : null,
197
-                'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null,
198
-                'READONLY_USER'          => isset($body->READONLY_USER) ? $body->READONLY_USER : null,
199
-                'date_of_birth'          => isset($body->date_of_birth) ? $body->date_of_birth : null,
200
-                'member_first_name'      => isset($body->member_first_name) ? $body->member_first_name : null,
201
-                'member_password'        => isset($body->member_password) ? $body->member_password : null,
202
-                'HIDE_NONFUTURE_ROUTES'  => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null,
203
-                'member_last_name'       => isset($body->member_last_name) ? $body->member_last_name : null,
204
-                'SHOW_ALL_VEHICLES'      => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null,
205
-                'SHOW_ALL_DRIVERS'       => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null
206
-            )
185
+	public static function updateMember($body)
186
+	{
187
+		$response = Route4Me::makeRequst(array(
188
+			'url'    => Endpoint::USER_V4,
189
+			'method' => 'PUT',
190
+			'body'   => array(
191
+				'member_id'              => isset($body->member_id) ? $body->member_id : null,
192
+				'member_phone'           => isset($body->member_phone) ? $body->member_phone : null,
193
+				'HIDE_ROUTED_ADDRESSES'  => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null,
194
+				'member_zipcode'         => isset($body->member_zipcode) ? $body->member_zipcode : null,
195
+				'route_count'            => isset($body->route_count) ? $body->route_count : null,
196
+				'member_email'           => isset($body->member_email) ? $body->member_email : null,
197
+				'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null,
198
+				'READONLY_USER'          => isset($body->READONLY_USER) ? $body->READONLY_USER : null,
199
+				'date_of_birth'          => isset($body->date_of_birth) ? $body->date_of_birth : null,
200
+				'member_first_name'      => isset($body->member_first_name) ? $body->member_first_name : null,
201
+				'member_password'        => isset($body->member_password) ? $body->member_password : null,
202
+				'HIDE_NONFUTURE_ROUTES'  => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null,
203
+				'member_last_name'       => isset($body->member_last_name) ? $body->member_last_name : null,
204
+				'SHOW_ALL_VEHICLES'      => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null,
205
+				'SHOW_ALL_DRIVERS'       => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null
206
+			)
207 207
 
208
-        ));
208
+		));
209 209
         
210
-        return $response;
211
-    }
210
+		return $response;
211
+	}
212 212
 
213
-    public static function deleteMember($body)
214
-    {
215
-        $response = Route4Me::makeRequst(array(
216
-            'url'    => Endpoint::USER_V4,
217
-            'method' => 'DELETE',
218
-            'body'   => array(
219
-                'member_id' =>  isset($body->member_id) ? $body->member_id : null
220
-            )
213
+	public static function deleteMember($body)
214
+	{
215
+		$response = Route4Me::makeRequst(array(
216
+			'url'    => Endpoint::USER_V4,
217
+			'method' => 'DELETE',
218
+			'body'   => array(
219
+				'member_id' =>  isset($body->member_id) ? $body->member_id : null
220
+			)
221 221
 
222
-        ));
222
+		));
223 223
         
224
-        return $response;
225
-    }
224
+		return $response;
225
+	}
226 226
     
227
-    public static function newAccountRegistration($body)
228
-    {
229
-        $response = Route4Me::makeRequst(array(
230
-            'url'    => Endpoint::REGISTER_ACTION,
231
-            'method' => 'POST',
232
-            'query'  => array(
233
-                'plan' => isset($body->plan) ? $body->plan : null
234
-            ),
235
-            'body'   => array(
236
-                'strEmail'                        => isset($body->strEmail) ? $body->strEmail : null,
237
-                'strPassword_1'                   => isset($body->strPassword_1) ? $body->strPassword_1 : null,
238
-                'strPassword_2'                   => isset($body->strPassword_2) ? $body->strPassword_2 : null,
239
-                'strFirstName'                    => isset($body->strFirstName) ? $body->strFirstName : null,
240
-                'strLastName'                     => isset($body->strLastName) ? $body->strLastName : null,
241
-                'format'                          => isset($body->format) ? $body->format : null,
242
-                'strIndustry'                     => isset($body->strIndustry) ? $body->strIndustry : null,
243
-                'chkTerms'                        => isset($body->chkTerms) ? $body->chkTerms : null,
244
-                'device_type'                     => isset($body->device_type) ? $body->device_type : null,
245
-                'strSubAccountType'               => isset($body->strSubAccountType) ? $body->strSubAccountType : null,
246
-                'blDisableMarketing'              => isset($body->blDisableMarketing) ? $body->blDisableMarketing : false,
247
-                'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) 
248
-                                                     ? $body->blDisableAccountActivationEmail : false
249
-            ),
250
-            'HTTPHEADER'  => 'Content-Type: multipart/form-data'
251
-        ));
227
+	public static function newAccountRegistration($body)
228
+	{
229
+		$response = Route4Me::makeRequst(array(
230
+			'url'    => Endpoint::REGISTER_ACTION,
231
+			'method' => 'POST',
232
+			'query'  => array(
233
+				'plan' => isset($body->plan) ? $body->plan : null
234
+			),
235
+			'body'   => array(
236
+				'strEmail'                        => isset($body->strEmail) ? $body->strEmail : null,
237
+				'strPassword_1'                   => isset($body->strPassword_1) ? $body->strPassword_1 : null,
238
+				'strPassword_2'                   => isset($body->strPassword_2) ? $body->strPassword_2 : null,
239
+				'strFirstName'                    => isset($body->strFirstName) ? $body->strFirstName : null,
240
+				'strLastName'                     => isset($body->strLastName) ? $body->strLastName : null,
241
+				'format'                          => isset($body->format) ? $body->format : null,
242
+				'strIndustry'                     => isset($body->strIndustry) ? $body->strIndustry : null,
243
+				'chkTerms'                        => isset($body->chkTerms) ? $body->chkTerms : null,
244
+				'device_type'                     => isset($body->device_type) ? $body->device_type : null,
245
+				'strSubAccountType'               => isset($body->strSubAccountType) ? $body->strSubAccountType : null,
246
+				'blDisableMarketing'              => isset($body->blDisableMarketing) ? $body->blDisableMarketing : false,
247
+				'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) 
248
+													 ? $body->blDisableAccountActivationEmail : false
249
+			),
250
+			'HTTPHEADER'  => 'Content-Type: multipart/form-data'
251
+		));
252 252
         
253
-        return $response;
254
-    }
253
+		return $response;
254
+	}
255 255
     
256
-    public static function validateSession($params)
257
-    {
258
-        $response = Route4Me::makeRequst(array(
259
-            'url'    => Endpoint::VALIDATE_SESSION,
260
-            'method' => 'GET',
261
-            'query'  => array(
262
-                'session_guid' => isset($params->session_guid) ? $params->session_guid : null,
263
-                'member_id'    => isset($params->member_id) ? $params->member_id : null,
264
-                'format'       => isset($params->format) ? $params->format : null
265
-            )
266
-        ));
256
+	public static function validateSession($params)
257
+	{
258
+		$response = Route4Me::makeRequst(array(
259
+			'url'    => Endpoint::VALIDATE_SESSION,
260
+			'method' => 'GET',
261
+			'query'  => array(
262
+				'session_guid' => isset($params->session_guid) ? $params->session_guid : null,
263
+				'member_id'    => isset($params->member_id) ? $params->member_id : null,
264
+				'format'       => isset($params->format) ? $params->format : null
265
+			)
266
+		));
267 267
         
268
-        return $response;
269
-    }
268
+		return $response;
269
+	}
270 270
     
271
-    public static function memberAuthentication($body)
272
-    {
273
-        $response = Route4Me::makeRequst(array(
274
-            'url'    => Endpoint::AUTHENTICATE,
275
-            'method' => 'POST',
276
-            'body'   => array(
277
-                'strEmail'    => isset($body->strEmail) ? $body->strEmail : null,
278
-                'strPassword' => isset($body->strPassword) ? $body->strPassword : null,
279
-                'format'      => isset($body->format) ? $body->format : null
280
-            ),
281
-            'HTTPHEADER'  => 'Content-Type: multipart/form-data'
282
-        ));
271
+	public static function memberAuthentication($body)
272
+	{
273
+		$response = Route4Me::makeRequst(array(
274
+			'url'    => Endpoint::AUTHENTICATE,
275
+			'method' => 'POST',
276
+			'body'   => array(
277
+				'strEmail'    => isset($body->strEmail) ? $body->strEmail : null,
278
+				'strPassword' => isset($body->strPassword) ? $body->strPassword : null,
279
+				'format'      => isset($body->format) ? $body->format : null
280
+			),
281
+			'HTTPHEADER'  => 'Content-Type: multipart/form-data'
282
+		));
283 283
         
284
-        return $response;
285
-    }
284
+		return $response;
285
+	}
286 286
     
287
-    public static function webinarRegistration($body)
288
-    {
289
-        $response = Route4Me::makeRequst(array(
290
-            'url'    => Endpoint::WEBINAR_REGISTER,
291
-            'method' => 'POST',
292
-            'body'   => array(
293
-                'email_address'  => isset($body->email_address) ? $body->email_address : null,
294
-                'first_name'     => isset($body->first_name) ? $body->first_name : null,
295
-                'last_name'      => isset($body->last_name) ? $body->last_name : null,
296
-                'phone_number'   => isset($body->phone_number) ? $body->phone_number : null,
297
-                'phone_number'   => isset($body->phone_number) ? $body->phone_number : null,
298
-                'member_id'      => isset($body->member_id) ? $body->member_id : null,
299
-                'webiinar_date'  => isset($body->webiinar_date) ? $body->webiinar_date : null,
300
-            )
287
+	public static function webinarRegistration($body)
288
+	{
289
+		$response = Route4Me::makeRequst(array(
290
+			'url'    => Endpoint::WEBINAR_REGISTER,
291
+			'method' => 'POST',
292
+			'body'   => array(
293
+				'email_address'  => isset($body->email_address) ? $body->email_address : null,
294
+				'first_name'     => isset($body->first_name) ? $body->first_name : null,
295
+				'last_name'      => isset($body->last_name) ? $body->last_name : null,
296
+				'phone_number'   => isset($body->phone_number) ? $body->phone_number : null,
297
+				'phone_number'   => isset($body->phone_number) ? $body->phone_number : null,
298
+				'member_id'      => isset($body->member_id) ? $body->member_id : null,
299
+				'webiinar_date'  => isset($body->webiinar_date) ? $body->webiinar_date : null,
300
+			)
301 301
 
302
-        ));
302
+		));
303 303
         
304
-        return $response;
305
-    }
304
+		return $response;
305
+	}
306 306
     
307
-    public static function purchaseUserLicense($body)
308
-    {
309
-        $response = Route4Me::makeRequst(array(
310
-            'url'    => Endpoint::USER_LICENSE,
311
-            'method' => 'POST',
312
-            'query'  => array(
313
-                'device_id'         => isset($body->device_id) ? $body->device_id : null
314
-            ),
315
-            'body'   => array(
316
-                'member_id'         => isset($body->member_id) ? $body->member_id : null,
317
-                'session_guid'      => isset($body->session_guid) ? $body->session_guid : null,
318
-                'device_id'         => isset($body->device_id) ? $body->device_id : null,
319
-                'device_type'       => isset($body->device_type) ? $body->device_type : null,
320
-                'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null,
321
-                'token'             => isset($body->token) ? $body->token : null,
322
-                'payload'           => isset($body->payload) ? $body->payload : null,
323
-                'format'            => isset($body->format) ? $body->format : null,
324
-            )
325
-        ));
307
+	public static function purchaseUserLicense($body)
308
+	{
309
+		$response = Route4Me::makeRequst(array(
310
+			'url'    => Endpoint::USER_LICENSE,
311
+			'method' => 'POST',
312
+			'query'  => array(
313
+				'device_id'         => isset($body->device_id) ? $body->device_id : null
314
+			),
315
+			'body'   => array(
316
+				'member_id'         => isset($body->member_id) ? $body->member_id : null,
317
+				'session_guid'      => isset($body->session_guid) ? $body->session_guid : null,
318
+				'device_id'         => isset($body->device_id) ? $body->device_id : null,
319
+				'device_type'       => isset($body->device_type) ? $body->device_type : null,
320
+				'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null,
321
+				'token'             => isset($body->token) ? $body->token : null,
322
+				'payload'           => isset($body->payload) ? $body->payload : null,
323
+				'format'            => isset($body->format) ? $body->format : null,
324
+			)
325
+		));
326 326
         
327
-        return $response;
328
-    }
327
+		return $response;
328
+	}
329 329
     
330
-    public static function newMemberConfigKey($body)
331
-    {
332
-        $response = Route4Me::makeRequst(array(
333
-            'url'    => Endpoint::CONFIGURATION_SETTINGS,
334
-            'method' => 'POST',
335
-            'body'   => array(
336
-                'config_key'   => isset($body->config_key) ? $body->config_key : null,
337
-                'config_value' => isset($body->config_value) ? $body->config_value : null
338
-            )
339
-        ));
330
+	public static function newMemberConfigKey($body)
331
+	{
332
+		$response = Route4Me::makeRequst(array(
333
+			'url'    => Endpoint::CONFIGURATION_SETTINGS,
334
+			'method' => 'POST',
335
+			'body'   => array(
336
+				'config_key'   => isset($body->config_key) ? $body->config_key : null,
337
+				'config_value' => isset($body->config_value) ? $body->config_value : null
338
+			)
339
+		));
340 340
         
341
-        return $response;
342
-    }
341
+		return $response;
342
+	}
343 343
     
344
-    public static function removeMemberConfigKey($body)
345
-    {
346
-        $response = Route4Me::makeRequst(array(
347
-            'url'    => Endpoint::CONFIGURATION_SETTINGS,
348
-            'method' => 'DELETE',
349
-            'body'   => array(
350
-                'config_key' =>  isset($body->config_key) ? $body->config_key : null
351
-            )
352
-        ));
344
+	public static function removeMemberConfigKey($body)
345
+	{
346
+		$response = Route4Me::makeRequst(array(
347
+			'url'    => Endpoint::CONFIGURATION_SETTINGS,
348
+			'method' => 'DELETE',
349
+			'body'   => array(
350
+				'config_key' =>  isset($body->config_key) ? $body->config_key : null
351
+			)
352
+		));
353 353
         
354
-        return $response;
355
-    }
354
+		return $response;
355
+	}
356 356
     
357
-    public static function getMemberConfigData($body)
358
-    {
359
-        $response = Route4Me::makeRequst(array(
360
-            'url'    => Endpoint::CONFIGURATION_SETTINGS,
361
-            'method' => 'GET',
362
-            'query'  => array(
363
-                'config_key' =>  isset($body->config_key) ? $body->config_key : null
364
-            )
365
-        ));
357
+	public static function getMemberConfigData($body)
358
+	{
359
+		$response = Route4Me::makeRequst(array(
360
+			'url'    => Endpoint::CONFIGURATION_SETTINGS,
361
+			'method' => 'GET',
362
+			'query'  => array(
363
+				'config_key' =>  isset($body->config_key) ? $body->config_key : null
364
+			)
365
+		));
366 366
         
367
-        return $response;
368
-    }
367
+		return $response;
368
+	}
369 369
 
370
-    public static function updateMemberConfigKey($body)
371
-    {
372
-        $response = Route4Me::makeRequst(array(
373
-            'url'    => Endpoint::CONFIGURATION_SETTINGS,
374
-            'method' => 'PUT',
375
-            'body'   => array(
376
-                'config_key'   => isset($body->config_key) ? $body->config_key : null,
377
-                'config_value' => isset($body->config_value) ? $body->config_value : null
378
-            )
379
-        ));
370
+	public static function updateMemberConfigKey($body)
371
+	{
372
+		$response = Route4Me::makeRequst(array(
373
+			'url'    => Endpoint::CONFIGURATION_SETTINGS,
374
+			'method' => 'PUT',
375
+			'body'   => array(
376
+				'config_key'   => isset($body->config_key) ? $body->config_key : null,
377
+				'config_value' => isset($body->config_value) ? $body->config_value : null
378
+			)
379
+		));
380 380
         
381
-        return $response;
382
-    }
381
+		return $response;
382
+	}
383 383
 }
Please login to merge, or discard this patch.
examples/Activities/GetActivities.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 Route4Me::setApiKey('11111111111111111111111111111111');
15 15
 
16 16
 $activityParameters = ActivityParameters::fromArray(array(
17
-    "limit"  => 10,
18
-    "offset" => 0
17
+	"limit"  => 10,
18
+	"offset" => 0
19 19
 ));
20 20
 
21 21
 $activities = new ActivityParameters();
@@ -23,6 +23,6 @@  discard block
 block discarded – undo
23 23
 $results = $activities->getValue($actresults, "results");
24 24
 
25 25
 foreach ($results as $result) {
26
-    Route4Me::simplePrint($result);
27
-    echo "<br>";
26
+	Route4Me::simplePrint($result);
27
+	echo "<br>";
28 28
 }
Please login to merge, or discard this patch.
examples/Activities/GetLastActivities.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 Route4Me::setApiKey('11111111111111111111111111111111');
17 17
 
18 18
 $activityParameters = ActivityParameters::fromArray(array(
19
-    "limit"  => 10,
20
-    "offset" => 0,
21
-    "start"  => strtotime("-1 week")
19
+	"limit"  => 10,
20
+	"offset" => 0,
21
+	"start"  => strtotime("-1 week")
22 22
 ));
23 23
 
24 24
 $activities = new ActivityParameters();
@@ -26,6 +26,6 @@  discard block
 block discarded – undo
26 26
 $results = $activities->getValue($actresults, "results");
27 27
 
28 28
 foreach ($results as $result) {
29
-    Route4Me::simplePrint($result);
30
-    echo "<br>";
29
+	Route4Me::simplePrint($result);
30
+	echo "<br>";
31 31
 }
Please login to merge, or discard this patch.
examples/Optimizations/hybridOptimization.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 $locationsFieldsMapping['monthly_nth_wwhat'] = 17;
45 45
 
46 46
 if (($handle = fopen("$source_file", "r"))!==FALSE) {
47
-    $oAbook = new AddressBookLocation();
47
+	$oAbook = new AddressBookLocation();
48 48
 
49
-    $results = $oAbook->addLocationsFromCsvFile($handle, $locationsFieldsMapping);
49
+	$results = $oAbook->addLocationsFromCsvFile($handle, $locationsFieldsMapping);
50 50
     
51
-    echo "Errors: <br><br>";
51
+	echo "Errors: <br><br>";
52 52
     
53
-    foreach ($results['fail'] as $evalue) {
54
-        echo $evalue."<br>";
55
-    }
53
+	foreach ($results['fail'] as $evalue) {
54
+		echo $evalue."<br>";
55
+	}
56 56
     
57
-    echo "Successes: <br><br>";
57
+	echo "Successes: <br><br>";
58 58
     
59
-    foreach ($results['success'] as $svalue) {
60
-        echo $svalue."<br>";
61
-    }
59
+	foreach ($results['success'] as $svalue) {
60
+		echo $svalue."<br>";
61
+	}
62 62
 }
63 63
 
64 64
 /* Add orders with schedules from a CSV file  */
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
 $ordersFieldsMapping['day_scheduled_for_YYMMDD'] = 8;
79 79
 
80 80
 if (($handle = fopen("$orders_file", "r"))!==FALSE) {
81
-    $order = new Order();
82
-    $results = $order->addOrdersFromCsvFile($handle, $ordersFieldsMapping);
81
+	$order = new Order();
82
+	$results = $order->addOrdersFromCsvFile($handle, $ordersFieldsMapping);
83 83
     
84
-    echo "Errors: <br><br>";
84
+	echo "Errors: <br><br>";
85 85
     
86
-    foreach ($results['fail'] as $evalue) {
87
-        echo $evalue."<br>";
88
-    }
86
+	foreach ($results['fail'] as $evalue) {
87
+		echo $evalue."<br>";
88
+	}
89 89
     
90
-    echo "Successes: <br><br>";
90
+	echo "Successes: <br><br>";
91 91
     
92
-    foreach ($results['success'] as $svalue) {
93
-        echo $svalue."<br>";
94
-    }
92
+	foreach ($results['success'] as $svalue) {
93
+		echo $svalue."<br>";
94
+	}
95 95
 }
96 96
 
97 97
 /* Get Hybrid Optimization */
@@ -100,63 +100,63 @@  discard block
 block discarded – undo
100 100
 $sched_date = date("Y-m-d", $ep);
101 101
 
102 102
 $hybridParams = array(
103
-    "target_date_string" => $sched_date,
104
-    "timezone_offset_minutes" => 480
103
+	"target_date_string" => $sched_date,
104
+	"timezone_offset_minutes" => 480
105 105
 );
106 106
 
107 107
 $optimization = new OptimizationProblem(); 
108 108
 $hybridOptimization = $optimization->getHybridOptimization($hybridParams);
109 109
 
110 110
 if ($hybridOptimization!=null) {
111
-    if (isset($hybridOptimization['optimization_problem_id'])) {
112
-        $optid = $hybridOptimization['optimization_problem_id'];
111
+	if (isset($hybridOptimization['optimization_problem_id'])) {
112
+		$optid = $hybridOptimization['optimization_problem_id'];
113 113
         
114
-        echo "Hibrid optimization with optimization_problem_id = $optid <br><br>";
114
+		echo "Hibrid optimization with optimization_problem_id = $optid <br><br>";
115 115
         
116
-        /* Add depots to the Hybrid Optimization */
117
-        $depotfile = "depots.csv";
116
+		/* Add depots to the Hybrid Optimization */
117
+		$depotfile = "depots.csv";
118 118
         
119
-        if (($handle = fopen("$depotfile", "r"))!==FALSE) {
120
-            $columns = fgetcsv($handle, $max_line_length, $delemietr);
119
+		if (($handle = fopen("$depotfile", "r"))!==FALSE) {
120
+			$columns = fgetcsv($handle, $max_line_length, $delemietr);
121 121
             
122
-            if (empty($columns)) {
123
-                $error['message'] = 'Empty';
124
-                return ($error);
125
-            }
122
+			if (empty($columns)) {
123
+				$error['message'] = 'Empty';
124
+				return ($error);
125
+			}
126 126
             
127
-            $depotsParams = array(
128
-                'optimization_problem_id' => $optid,
129
-                'delete_old_depots'       => true,
130
-            );
127
+			$depotsParams = array(
128
+				'optimization_problem_id' => $optid,
129
+				'delete_old_depots'       => true,
130
+			);
131 131
             
132
-            $iRow = 1;
133
-            $depotAddresses = array();
132
+			$iRow = 1;
133
+			$depotAddresses = array();
134 134
             
135
-            while (($rows = fgetcsv($handle, $max_line_length, $delemietr))!==false) {
136
-                if ($rows[0] && $rows[1] && $rows[3] && array(null)!==$rows) {
137
-                    $depotAddress['lat'] = $rows[0];
138
-                    $depotAddress['lng'] = $rows[1];
139
-                    $depotAddress['address'] = $rows[3];   
140
-                    array_push($depotAddresses, $depotAddress);
141
-                }
142
-            }
135
+			while (($rows = fgetcsv($handle, $max_line_length, $delemietr))!==false) {
136
+				if ($rows[0] && $rows[1] && $rows[3] && array(null)!==$rows) {
137
+					$depotAddress['lat'] = $rows[0];
138
+					$depotAddress['lng'] = $rows[1];
139
+					$depotAddress['address'] = $rows[3];   
140
+					array_push($depotAddresses, $depotAddress);
141
+				}
142
+			}
143 143
             
144
-            $depotsParams['new_depots'] = $depotAddresses;
144
+			$depotsParams['new_depots'] = $depotAddresses;
145 145
             
146
-            $optProblem = new OptimizationProblem();
146
+			$optProblem = new OptimizationProblem();
147 147
             
148
-            $resultDepots = $optProblem->addDepotsToHybrid($depotsParams);
148
+			$resultDepots = $optProblem->addDepotsToHybrid($depotsParams);
149 149
             
150
-            /* Reoptimize hybrid optimization */
150
+			/* Reoptimize hybrid optimization */
151 151
             
152
-            if ($resultDepots!=null) {
153
-                $problemParams = array(
154
-                    'optimization_problem_id'  =>  $optid
155
-                );
156
-                $problem = OptimizationProblem::reoptimize($problemParams);
152
+			if ($resultDepots!=null) {
153
+				$problemParams = array(
154
+					'optimization_problem_id'  =>  $optid
155
+				);
156
+				$problem = OptimizationProblem::reoptimize($problemParams);
157 157
                 
158
-                Route4Me::simplePrint($problem);
159
-            }
160
-        }
161
-    }
158
+				Route4Me::simplePrint($problem);
159
+			}
160
+		}
161
+	}
162 162
 }
Please login to merge, or discard this patch.
examples/AvoidanceZones/AddAvoidanceZone.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@
 block discarded – undo
16 16
 
17 17
 $territoryParams['type'] = TerritoryTypes::CIRCLE;
18 18
 $territoryParams['data'] = array(
19
-    "37.569752822786455,-77.47833251953125",
20
-    "5000"
19
+	"37.569752822786455,-77.47833251953125",
20
+	"5000"
21 21
 );
22 22
 
23 23
 $AvoidanceZoneParameters = AvoidanceZone::fromArray(array(
24
-    "territory_name"   => "Test Circle Avoidance Zone ".strval(rand(10000,99999)),
25
-    "territory_color"  => "ff7700",
26
-    "territory"        => $territoryParams
24
+	"territory_name"   => "Test Circle Avoidance Zone ".strval(rand(10000,99999)),
25
+	"territory_color"  => "ff7700",
26
+	"territory"        => $territoryParams
27 27
 ));
28 28
 
29 29
 $avoidancezone = new AvoidanceZone();
Please login to merge, or discard this patch.