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.
Test Failed
Push — master ( d9a634...e591c7 )
by Juan Jose
07:17 queued 16s
created
src/Route4Me/V5/Addresses/AddressManifest.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -10,87 +10,87 @@
 block discarded – undo
10 10
  */
11 11
 class AddressManifest extends \Route4Me\Common
12 12
 {
13
-    /** How much time is to be spent on service from the start in seconds.
14
-     * @var integer $running_service_time
15
-     */
16
-    public $running_service_time;
17
-
18
-    /** How much time is spent driving from the start in seconds.
19
-     * @var integer $running_travel_time
20
-     */
21
-    public $running_travel_time;
22
-
23
-    /** Running wait time.
24
-     * @var integer $running_wait_time
25
-     */
26
-    public $running_wait_time;
27
-
28
-    /** Distance traversed before reaching this address.
29
-     * @var double $running_distance
30
-     */
31
-    public $running_distance;
32
-
33
-    /** Expected fuel consumption from the start.
34
-     * @var double $fuel_from_start
35
-     */
36
-    public $fuel_from_start;
37
-
38
-    /** Expected fuel cost from start.
39
-     * @var double $fuel_cost_from_start
40
-     */
41
-    public $fuel_cost_from_start;
42
-
43
-    /** Projected arrival time UTC unixtime.
44
-     * @var integer $projected_arrival_time_ts
45
-     */
46
-    public $projected_arrival_time_ts;
47
-
48
-    /** Estimated departure time UTC unixtime.
49
-     * @var integer $projected_departure_time_ts
50
-     */
51
-    public $projected_departure_time_ts;
52
-
53
-    /** Time when the address was marked as visited UTC unixtime.
54
-     * This is actually equal to timestamp_last_visited most of the time.
55
-     * @var integer $actual_arrival_time_ts
56
-     */
57
-    public $actual_arrival_time_ts;
58
-
59
-    /** Time when the address was marked as departed UTC.
60
-     * This is actually equal to timestamp_last_departed most of the time.
61
-     * @var integer $actual_departure_time_ts
62
-     */
63
-    public $actual_departure_time_ts;
64
-
65
-    /** Estimated arrival time based on the current route progress,
66
-     * i.e. based on the last known actual_arrival_time.
67
-     * @var integer $estimated_arrival_time_ts
68
-     */
69
-    public $estimated_arrival_time_ts;
70
-
71
-    /** Estimated departure time based on the current route progress.
72
-     * @var integer $estimated_departure_time_ts
73
-     */
74
-    public $estimated_departure_time_ts;
75
-
76
-    /** Scheduled arrival time.
77
-     * @var integer $scheduled_arrival_time_ts
78
-     */
79
-    public $scheduled_arrival_time_ts;
80
-
81
-    /** Scheduled departure time.
82
-     * @var integer $scheduled_departure_time_ts
83
-     */
84
-    public $scheduled_departure_time_ts;
85
-
86
-    /** This is the difference between the originally projected arrival time and Actual Arrival Time.
87
-     * @var integer $time_impact
88
-     */
89
-    public $time_impact;
90
-
91
-    /** Distance traversed before reaching this address.
92
-     * @var double $udu_running_distance
93
-     */
94
-    public $udu_running_distance;
13
+	/** How much time is to be spent on service from the start in seconds.
14
+	 * @var integer $running_service_time
15
+	 */
16
+	public $running_service_time;
17
+
18
+	/** How much time is spent driving from the start in seconds.
19
+	 * @var integer $running_travel_time
20
+	 */
21
+	public $running_travel_time;
22
+
23
+	/** Running wait time.
24
+	 * @var integer $running_wait_time
25
+	 */
26
+	public $running_wait_time;
27
+
28
+	/** Distance traversed before reaching this address.
29
+	 * @var double $running_distance
30
+	 */
31
+	public $running_distance;
32
+
33
+	/** Expected fuel consumption from the start.
34
+	 * @var double $fuel_from_start
35
+	 */
36
+	public $fuel_from_start;
37
+
38
+	/** Expected fuel cost from start.
39
+	 * @var double $fuel_cost_from_start
40
+	 */
41
+	public $fuel_cost_from_start;
42
+
43
+	/** Projected arrival time UTC unixtime.
44
+	 * @var integer $projected_arrival_time_ts
45
+	 */
46
+	public $projected_arrival_time_ts;
47
+
48
+	/** Estimated departure time UTC unixtime.
49
+	 * @var integer $projected_departure_time_ts
50
+	 */
51
+	public $projected_departure_time_ts;
52
+
53
+	/** Time when the address was marked as visited UTC unixtime.
54
+	 * This is actually equal to timestamp_last_visited most of the time.
55
+	 * @var integer $actual_arrival_time_ts
56
+	 */
57
+	public $actual_arrival_time_ts;
58
+
59
+	/** Time when the address was marked as departed UTC.
60
+	 * This is actually equal to timestamp_last_departed most of the time.
61
+	 * @var integer $actual_departure_time_ts
62
+	 */
63
+	public $actual_departure_time_ts;
64
+
65
+	/** Estimated arrival time based on the current route progress,
66
+	 * i.e. based on the last known actual_arrival_time.
67
+	 * @var integer $estimated_arrival_time_ts
68
+	 */
69
+	public $estimated_arrival_time_ts;
70
+
71
+	/** Estimated departure time based on the current route progress.
72
+	 * @var integer $estimated_departure_time_ts
73
+	 */
74
+	public $estimated_departure_time_ts;
75
+
76
+	/** Scheduled arrival time.
77
+	 * @var integer $scheduled_arrival_time_ts
78
+	 */
79
+	public $scheduled_arrival_time_ts;
80
+
81
+	/** Scheduled departure time.
82
+	 * @var integer $scheduled_departure_time_ts
83
+	 */
84
+	public $scheduled_departure_time_ts;
85
+
86
+	/** This is the difference between the originally projected arrival time and Actual Arrival Time.
87
+	 * @var integer $time_impact
88
+	 */
89
+	public $time_impact;
90
+
91
+	/** Distance traversed before reaching this address.
92
+	 * @var double $udu_running_distance
93
+	 */
94
+	public $udu_running_distance;
95 95
 
96 96
 }
97 97
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/V5/Addresses/GeoPoint.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  */
11 11
 class GeoPoint extends \Route4Me\Common
12 12
 {
13
-    /** Latitude
14
-     * @var double $lat
15
-     */
16
-    public $lat;
13
+	/** Latitude
14
+	 * @var double $lat
15
+	 */
16
+	public $lat;
17 17
 
18
-    /** Longitude
19
-     * @var double $lng
20
-     */
21
-    public $lng;
18
+	/** Longitude
19
+	 * @var double $lng
20
+	 */
21
+	public $lng;
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/V5/Addresses/OverrideAddresses.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,21 +11,21 @@
 block discarded – undo
11 11
  */
12 12
 class OverrideAddresses
13 13
 {
14
-    /**
15
-     * The service time specified or all the addresses in the route.
16
-     * @var long
17
-     */
18
-    public $time;
14
+	/**
15
+	 * The service time specified or all the addresses in the route.
16
+	 * @var long
17
+	 */
18
+	public $time;
19 19
 
20
-    /**
21
-     * Route address stop type
22
-     * @var string
23
-     */
24
-    public $address_stop_type;
20
+	/**
21
+	 * Route address stop type
22
+	 * @var string
23
+	 */
24
+	public $address_stop_type;
25 25
 
26
-    /**
27
-     * The address group
28
-     * @var string
29
-     */
30
-    public $group;
26
+	/**
27
+	 * The address group
28
+	 * @var string
29
+	 */
30
+	public $group;
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/V5/DataObjectBase.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@
 block discarded – undo
6 6
 
7 7
 class DataObjectBase extends \Route4Me\Common
8 8
 {
9
-    /** @var string $optimization_problem_id
10
-     * Optimization problem ID
11
-     */
12
-    public $optimization_problem_id;
13
-
14
-    /** @var string $smart_optimization_id
15
-     * Smart Optimization Problem ID
16
-     */
17
-    public $smart_optimization_id;
18
-
19
-    /** @var long $created_timestamp
20
-     * When the optimization problem was created.
21
-     */
22
-    public $created_timestamp;
23
-
24
-    /** @var RouteParameters $parameters
25
-     * Route Parameters.
26
-     */
27
-    public $parameters = [];
28
-
29
-    /** @var Address[] $addresses
30
-     * An array ot the Address type objects.
31
-     */
32
-    public $addresses = [];
33
-
34
-    /** @var string[] $links
35
-     * The links to the GET operations for the optimization problem.
36
-     */
37
-    public $links = [];
9
+	/** @var string $optimization_problem_id
10
+	 * Optimization problem ID
11
+	 */
12
+	public $optimization_problem_id;
13
+
14
+	/** @var string $smart_optimization_id
15
+	 * Smart Optimization Problem ID
16
+	 */
17
+	public $smart_optimization_id;
18
+
19
+	/** @var long $created_timestamp
20
+	 * When the optimization problem was created.
21
+	 */
22
+	public $created_timestamp;
23
+
24
+	/** @var RouteParameters $parameters
25
+	 * Route Parameters.
26
+	 */
27
+	public $parameters = [];
28
+
29
+	/** @var Address[] $addresses
30
+	 * An array ot the Address type objects.
31
+	 */
32
+	public $addresses = [];
33
+
34
+	/** @var string[] $links
35
+	 * The links to the GET operations for the optimization problem.
36
+	 */
37
+	public $links = [];
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/OptimizationProblemParams.php 1 patch
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -6,131 +6,131 @@
 block discarded – undo
6 6
 
7 7
 class OptimizationProblemParams extends Common
8 8
 {
9
-    public $optimization_problem_id;
10
-    public $reoptimize;
11
-    public $addresses = [];
12
-    public $depots = [];
13
-    public $parameters;
14
-    public $directions;
15
-    public $format;
16
-    public $route_path_output;
17
-    public $optimized_callback_url;
18
-    public $redirect = true;
19
-
20
-    public static function fromArray($params)
21
-    {
22
-        $param = new self();
23
-        if (!isset($params['addresses'])) {
24
-            throw new BadParam('addresses must be provided.');
25
-        }
26
-
27
-        if (!isset($params['parameters'])) {
28
-            throw new BadParam('parameters must be provided.');
29
-        }
30
-
31
-        if ($params['parameters'] instanceof RouteParameters) {
32
-            $param->setParameters($params['parameters']);
33
-        } else {
34
-            $param->setParameters(RouteParameters::fromArray($params['parameters']));
35
-        }
36
-
37
-        foreach ($params['addresses'] as $address) {
38
-            if (!($address instanceof Address)) {
39
-                $address = Address::fromArray($address);
40
-            }
41
-
42
-            $param->addAddress($address);
43
-        }
44
-
45
-        if (isset($params['depots'] )) {
46
-            foreach ($params['depots'] as $depot) {
47
-                if (!($depot instanceof Address)) {
48
-                    $depot = Address::fromArray($depot);
49
-                }
50
-
51
-                $param->addAddress($address);
52
-            }
53
-        }
54
-
55
-        $param->directions = self::getValue($params, 'directions');
56
-        $param->format = self::getValue($params, 'format');
57
-        $param->route_path_output = self::getValue($params, 'route_path_output');
58
-        $param->optimized_callback_url = self::getValue($params, 'optimized_callback_url');
59
-        $param->optimization_problem_id = self::getValue($params, 'optimization_problem_id');
60
-        $param->reoptimize = self::getValue($params, 'reoptimize');
61
-        $param->redirect = filter_var(self::getValue($params, 'redirect', true), FILTER_VALIDATE_BOOLEAN);
62
-
63
-        return $param;
64
-    }
65
-
66
-    public function __construct()
67
-    {
68
-        $this->parameters = new RouteParameters();
69
-    }
70
-
71
-    public function setParameters(RouteParameters $params)
72
-    {
73
-        $this->parameters = $params;
74
-
75
-        return $this;
76
-    }
77
-
78
-    public function addAddress(Address $address)
79
-    {
80
-        $this->addresses[] = $address;
81
-
82
-        return $this;
83
-    }
84
-
85
-    public function addDepot(Address $depot)
86
-    {
87
-        $this->depots[] = $depot;
88
-
89
-        return $this;
90
-    }
91
-
92
-    public function getAddressesArray()
93
-    {
94
-        $addresses = [];
95
-
96
-        foreach ($this->addresses as $address) {
97
-            $addresses[] = $address->toArray();
98
-        }
99
-
100
-        return $addresses;
101
-    }
102
-
103
-    public function getDepotsArray()
104
-    {
105
-        $depots = [];
106
-
107
-        foreach ($this->depots as $depot) {
108
-            $depots[] = $depot->toArray();
109
-        }
110
-
111
-        return $depots;
112
-    }
113
-
114
-    public function getParametersArray()
115
-    {
116
-        return $this->parameters->toArray();
117
-    }
118
-
119
-    public function setAddresses(array $addresses)
120
-    {
121
-        foreach ($addresses as $address) {
122
-            $this->addAddress($address);
123
-        }
124
-
125
-        return $this;
126
-    }
127
-
128
-    public function setDepots(array $depots)
129
-    {
130
-        foreach ($depots as $depot) {
131
-            $this->addDepot($depot);
132
-        }
133
-
134
-        return $this;
135
-    }
9
+	public $optimization_problem_id;
10
+	public $reoptimize;
11
+	public $addresses = [];
12
+	public $depots = [];
13
+	public $parameters;
14
+	public $directions;
15
+	public $format;
16
+	public $route_path_output;
17
+	public $optimized_callback_url;
18
+	public $redirect = true;
19
+
20
+	public static function fromArray($params)
21
+	{
22
+		$param = new self();
23
+		if (!isset($params['addresses'])) {
24
+			throw new BadParam('addresses must be provided.');
25
+		}
26
+
27
+		if (!isset($params['parameters'])) {
28
+			throw new BadParam('parameters must be provided.');
29
+		}
30
+
31
+		if ($params['parameters'] instanceof RouteParameters) {
32
+			$param->setParameters($params['parameters']);
33
+		} else {
34
+			$param->setParameters(RouteParameters::fromArray($params['parameters']));
35
+		}
36
+
37
+		foreach ($params['addresses'] as $address) {
38
+			if (!($address instanceof Address)) {
39
+				$address = Address::fromArray($address);
40
+			}
41
+
42
+			$param->addAddress($address);
43
+		}
44
+
45
+		if (isset($params['depots'] )) {
46
+			foreach ($params['depots'] as $depot) {
47
+				if (!($depot instanceof Address)) {
48
+					$depot = Address::fromArray($depot);
49
+				}
50
+
51
+				$param->addAddress($address);
52
+			}
53
+		}
54
+
55
+		$param->directions = self::getValue($params, 'directions');
56
+		$param->format = self::getValue($params, 'format');
57
+		$param->route_path_output = self::getValue($params, 'route_path_output');
58
+		$param->optimized_callback_url = self::getValue($params, 'optimized_callback_url');
59
+		$param->optimization_problem_id = self::getValue($params, 'optimization_problem_id');
60
+		$param->reoptimize = self::getValue($params, 'reoptimize');
61
+		$param->redirect = filter_var(self::getValue($params, 'redirect', true), FILTER_VALIDATE_BOOLEAN);
62
+
63
+		return $param;
64
+	}
65
+
66
+	public function __construct()
67
+	{
68
+		$this->parameters = new RouteParameters();
69
+	}
70
+
71
+	public function setParameters(RouteParameters $params)
72
+	{
73
+		$this->parameters = $params;
74
+
75
+		return $this;
76
+	}
77
+
78
+	public function addAddress(Address $address)
79
+	{
80
+		$this->addresses[] = $address;
81
+
82
+		return $this;
83
+	}
84
+
85
+	public function addDepot(Address $depot)
86
+	{
87
+		$this->depots[] = $depot;
88
+
89
+		return $this;
90
+	}
91
+
92
+	public function getAddressesArray()
93
+	{
94
+		$addresses = [];
95
+
96
+		foreach ($this->addresses as $address) {
97
+			$addresses[] = $address->toArray();
98
+		}
99
+
100
+		return $addresses;
101
+	}
102
+
103
+	public function getDepotsArray()
104
+	{
105
+		$depots = [];
106
+
107
+		foreach ($this->depots as $depot) {
108
+			$depots[] = $depot->toArray();
109
+		}
110
+
111
+		return $depots;
112
+	}
113
+
114
+	public function getParametersArray()
115
+	{
116
+		return $this->parameters->toArray();
117
+	}
118
+
119
+	public function setAddresses(array $addresses)
120
+	{
121
+		foreach ($addresses as $address) {
122
+			$this->addAddress($address);
123
+		}
124
+
125
+		return $this;
126
+	}
127
+
128
+	public function setDepots(array $depots)
129
+	{
130
+		foreach ($depots as $depot) {
131
+			$this->addDepot($depot);
132
+		}
133
+
134
+		return $this;
135
+	}
136 136
 }
Please login to merge, or discard this patch.
src/Route4Me/Route.php 1 patch
Indentation   +805 added lines, -805 removed lines patch added patch discarded remove patch
@@ -12,809 +12,809 @@
 block discarded – undo
12 12
  */
13 13
 class Route extends Common
14 14
 {
15
-    /**
16
-     * The route ID
17
-     * @var string
18
-     */
19
-    public $route_id;
20
-
21
-    /**
22
-     * Member ID of a route owner
23
-     * @var integer
24
-     */
25
-    public $member_id;
26
-
27
-    /**
28
-     * Optimization problem ID
29
-     * @var string
30
-     */
31
-    public $optimization_problem_id;
32
-
33
-    /**
34
-     * Vehicle alias
35
-     * @var string
36
-     */
37
-    public $vehicle_alias;
38
-
39
-    /**
40
-     * Driver alias
41
-     * @var string
42
-     */
43
-    public $driver_alias;
44
-
45
-    /**
46
-     * Total route's trip distance
47
-     * @var double
48
-     */
49
-    public $trip_distance;
50
-
51
-    /**
52
-     * The UDU distance measurement unit for the route.<br>
53
-     * @note km or mi, the route4me api will convert all distance measurements into these units.
54
-     * @var string
55
-     */
56
-    public $udu_distance_unit;
57
-
58
-    /**
59
-     * Total route's UDU trip distance
60
-     * @var double
61
-     */
62
-    public $udu_trip_distance;
63
-
64
-    /** Miles per gallon
65
-     * @var double
66
-     */
67
-    public $mpg;
68
-
69
-    /**
70
-     * Gas price
71
-     * @var double
72
-     */
73
-    public $gas_price;
74
-
75
-    /**
76
-     * Total route duration (seconds)
77
-     * @var integer
78
-     */
79
-    public $route_duration_sec;
80
-
81
-    /**
82
-     * Number of the destinations in the route.
83
-     * @var integer
84
-     */
85
-    public $destination_count;
86
-
87
-    /**
88
-     * Notes count in the route.
89
-     * @var integer
90
-     */
91
-    public $notes_count;
92
-
93
-    /**
94
-     * Route parameters
95
-     * @var RouteParameters
96
-     */
97
-    public $parameters;
98
-
99
-    /**
100
-     * An array of the route addresses
101
-     * @var Address[]
102
-     */
103
-    public $addresses = [];
104
-
105
-    /**
106
-     * An array of the links
107
-     * @var string[]
108
-     */
109
-    public $links = [];
110
-
111
-    /**
112
-     * Edge by edge turn-by-turn directions.
113
-     * @var Direction[]
114
-     */
115
-    public $directions = [];
116
-
117
-    /**
118
-     * Edge-wise path to be drawn on the map.
119
-     * @var GeoPoint[]
120
-     */
121
-    public $path = [];
122
-
123
-    /**
124
-     * A collection of device tracking data with coordinates, speed, and timestamps.
125
-     * @var Tracking\TrackingHistory[]
126
-     */
127
-    public $tracking_history = [];
128
-
129
-    /**
130
-     * HTTP headers
131
-     * @var string
132
-     */
133
-    public $httpheaders;
134
-
135
-    /**
136
-     * If true, the route is unrouted.
137
-     * @var Boolean
138
-     */
139
-    public $is_unrouted;
140
-
141
-    /**
142
-     * User route rating [0, 5]. A null value means no rating was given.<br>
143
-     * Users can rate routes so that future optimizations take these ratings into account.
144
-     * @var integer
145
-     */
146
-    public $user_route_rating;
147
-
148
-    /**
149
-     * The member's email
150
-     * @var string
151
-     */
152
-    public $member_email;
153
-
154
-    /**
155
-     * URL to a member picture
156
-     * @var string
157
-     */
158
-    public $member_picture;
159
-
160
-    /**
161
-     * Member tracking subheadline.
162
-     * @var string
163
-     */
164
-    public $member_tracking_subheadline;
165
-
166
-    /**
167
-     * If true, the order is approved for execution.
168
-     * @var Boolean
169
-     */
170
-    public $approved_for_execution;
171
-
172
-    /**
173
-     * Counter of the approved revisions.
174
-     * @var integer
175
-     */
176
-    public $approved_revisions_counter;
177
-
178
-    /**
179
-     * The member's first name.
180
-     * @var string
181
-     */
182
-    public $member_first_name;
183
-
184
-    /**
185
-     * The member's last name.
186
-     * @var string
187
-     */
188
-    public $member_last_name;
189
-
190
-    /**
191
-     * Channel name
192
-     * @var string
193
-     */
194
-    public $channel_name;
195
-
196
-    /**
197
-     * Total cost of the route.
198
-     * @var double
199
-     */
200
-    public $route_cost;
201
-
202
-    /**
203
-     * Total route revenue
204
-     * @var double
205
-     */
206
-    public $route_revenue;
207
-
208
-    /**
209
-     * Net revenue per distance unit.
210
-     * @var double
211
-     */
212
-    public $net_revenue_per_distance_unit;
213
-
214
-    /**
215
-     * When route created (UNIX format timestamp).
216
-     * @var integer
217
-     */
218
-    public $created_timestamp;
219
-
220
-    /**
221
-     * Planned total route duration (seconds).
222
-     * @var integer
223
-     */
224
-    public $planned_total_route_duration;
225
-
226
-    /**
227
-     * Total wait time (seconds).
228
-     * @var integer
229
-     */
230
-    public $total_wait_time;
231
-
232
-    /**
233
-     * UDU Actual travel distance.
234
-     * @var double
235
-     */
236
-    public $udu_actual_travel_distance;
237
-
238
-    /**
239
-     * Actual travel distance.
240
-     * @var double
241
-     */
242
-    public $actual_travel_distance;
243
-
244
-    /**
245
-     * Actual travel time (seconds).
246
-     * @var integer
247
-     */
248
-    public $actual_travel_time;
249
-
250
-    /**
251
-     * Actual footsteps.
252
-     * @var integer
253
-     */
254
-    public $actual_footsteps;
255
-
256
-    /**
257
-     * Working time.
258
-     * @var integer
259
-     */
260
-    public $working_time;
261
-
262
-    /**
263
-     * Driving time.
264
-     * @var integer
265
-     */
266
-    public $driving_time;
267
-
268
-    /**
269
-     * Idling time.
270
-     * @var integer
271
-     */
272
-    public $idling_time;
273
-
274
-    /**
275
-     * Paying miles
276
-     * @var double
277
-     */
278
-    public $paying_miles;
279
-
280
-    /**
281
-     * Geofence polygon type.<br>
282
-     * enum: ["circle", "poly", "rect"]
283
-     * @var string
284
-     */
285
-    public $geofence_polygon_type;
286
-
287
-    /**
288
-     * Geofence polygon size.
289
-     * @var integer
290
-     */
291
-    public $geofence_polygon_size;
292
-
293
-    /**
294
-     * Route notes
295
-     * @var AddressNote[]
296
-     */
297
-    public $notes=[];
298
-
299
-    /**
300
-     * A vehicle assigned to the route.
301
-     * @var Vehicles\VehicleResponseV4
302
-     */
303
-    public $vehicle=[];
304
-
305
-    /**
306
-     * Member config key-value pairs.
307
-     * @var array
308
-     */
309
-    public $member_config_storage;
310
-
311
-    /**
312
-     * Original route
313
-     * @var Route
314
-     */
315
-    public $original_route;
316
-
317
-    /**
318
-     * If true, the route will be unlinked from the master optimization.
319
-     * @var Boolean
320
-     */
321
-    public $unlink_from_master_optimization;
322
-
323
-    public function __construct()
324
-    {
325
-        Route4Me::setBaseUrl(Endpoint::BASE_URL);
326
-    }
327
-
328
-    public static function fromArray(array $params)
329
-    {
330
-        $route = new self();
331
-        $route->route_id = Common::getValue($params, 'route_id');
332
-        $route->member_id = Common::getValue($params, 'member_id');
333
-        $route->member_email = Common::getValue($params, 'member_email');
334
-        $route->member_picture = Common::getValue($params, 'member_picture');
335
-        $route->member_tracking_subheadline = Common::getValue($params, 'member_tracking_subheadline');
336
-        $route->approved_for_execution = Common::getValue($params, 'approved_for_execution');
337
-        $route->approved_revisions_counter = Common::getValue($params, 'approved_revisions_counter');
338
-        $route->member_first_name = Common::getValue($params, 'member_first_name');
339
-        $route->member_last_name = Common::getValue($params, 'member_last_name');
340
-        $route->channel_name = Common::getValue($params, 'channel_name');
341
-        $route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id');
342
-        $route->user_route_rating = Common::getValue($params, 'user_route_rating');
343
-        $route->vehicle_alias = Common::getValue($params, 'vehicle_alias');
344
-        $route->driver_alias = Common::getValue($params, 'driver_alias');
345
-        $route->trip_distance = Common::getValue($params, 'trip_distance');
346
-        $route->udu_distance_unit = Common::getValue($params, 'udu_distance_unit');
347
-        $route->udu_trip_distance = Common::getValue($params, 'udu_trip_distance');
348
-        $route->mpg = Common::getValue($params, 'mpg');
349
-        $route->gas_price = Common::getValue($params, 'gas_price');
350
-        $route->route_duration_sec = Common::getvalue($params, 'route_duration_sec');
351
-        $route->planned_total_route_duration = Common::getvalue($params, 'planned_total_route_duration');
352
-        $route->total_wait_time = Common::getvalue($params, 'total_wait_time');
353
-        $route->udu_actual_travel_distance = Common::getvalue($params, 'udu_actual_travel_distance');
354
-        $route->actual_travel_distance = Common::getvalue($params, 'actual_travel_distance');
355
-        $route->actual_travel_time = Common::getvalue($params, 'actual_travel_time');
356
-        $route->actual_footsteps = Common::getvalue($params, 'actual_footsteps');
357
-        $route->working_time = Common::getvalue($params, 'working_time');
358
-        $route->driving_time = Common::getvalue($params, 'driving_time');
359
-        $route->idling_time = Common::getvalue($params, 'idling_time');
360
-        $route->paying_miles = Common::getvalue($params, 'paying_miles');
361
-        $route->geofence_polygon_type = Common::getvalue($params, 'geofence_polygon_type');
362
-        $route->geofence_polygon_size = Common::getvalue($params, 'geofence_polygon_size');
363
-        $route->destination_count = Common::getvalue($params, 'destination_count');
364
-        $route->notes_count = Common::getvalue($params, 'notes_count');
365
-        $route->is_unrouted = Common::getvalue($params, 'is_unrouted');
366
-        $route->route_cost = Common::getvalue($params, 'route_cost');
367
-        $route->route_revenue = Common::getvalue($params, 'route_revenue');
368
-        $route->net_revenue_per_distance_unit = Common::getvalue($params, 'net_revenue_per_distance_unit');
369
-        $route->created_timestamp = Common::getvalue($params, 'created_timestamp');
370
-
371
-        if (isset($params['vehicle'])) {
372
-            $route->vehicle = new Vehicle();
373
-            $route->vehicle = Vehicle::fromArray($params['vehicle']);
374
-            Route4Me::setBaseUrl(Endpoint::BASE_URL);
375
-        };
376
-
377
-        $route->member_config_storage = Common::getvalue($params, 'member_config_storage');
378
-
379
-        // Make RouteParameters
380
-        if (isset($params['parameters'])) {
381
-            $route->parameters = new RouteParameters();
382
-            $route->parameters = RouteParameters::fromArray($params['parameters']);
383
-            Route4Me::setBaseUrl(Endpoint::BASE_URL);
384
-        }
385
-
386
-        if (isset($params['addresses'])) {
387
-            $addresses = [];
388
-
389
-            foreach ($params['addresses'] as $address) {
390
-                $addresses[] = Address::fromArray($address);
391
-            }
392
-
393
-            $route->addresses = $addresses;
394
-        }
395
-
396
-        $route->links = Common::getValue($params, 'links', []);
397
-        $route->notes = Common::getValue($params, 'notes', []);
398
-        $route->directions = Common::getValue($params, 'directions', []);
399
-        $route->path = Common::getValue($params, 'path', []);
400
-        $route->tracking_history = Common::getValue($params, 'tracking_history', []);
401
-
402
-        if (isset($params['original_route'])) {
403
-            $route->original_route = Route::fromArray($params['original_route']);
404
-        };
405
-
406
-        return $route;
407
-    }
408
-
409
-    /**
410
-     * @param RouteParametersQuery $params
411
-     * @return An array of the routes
412
-     * @throws Exception\ApiError
413
-     */
414
-    public static function getRoutes($params = null)
415
-    {
416
-        $allQueryFields = ['route_id', 'original', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset','start_date','end_date'];
417
-
418
-        $result = Route4Me::makeRequst([
419
-            'url'       => Endpoint::ROUTE_V4,
420
-            'method'    => 'GET',
421
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
422
-        ]);
423
-
424
-        if (isset($params['route_id'])) {
425
-            if (strlen($params['route_id'])==32) {
426
-                return self::fromArray($result);
427
-            } else {
428
-                return $result;
429
-            }
430
-        } else {
431
-            $routes = [];
432
-            foreach ($result as $route) {
433
-                $routes[] = self::fromArray($route);
434
-            }
435
-
436
-            return $routes;
437
-        }
438
-    }
439
-
440
-    public function getRoutePoints($params)
441
-    {
442
-        $allQueryFields = ['route_id', 'route_path_output', 'compress_path_points', 'directions'];
443
-
444
-        $result = Route4Me::makeRequst([
445
-            'url'    => Endpoint::ROUTE_V4,
446
-            'method' => 'GET',
447
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
448
-        ]);
449
-
450
-        return $result;
451
-    }
452
-
453
-    public function duplicateRoute($routeIDs)
454
-    {
455
-        $result = Route4Me::makeRequst([
456
-            'url'    => Endpoint::ROUTE_V4,
457
-            'method' => 'POST',
458
-            'body'   => [
459
-                'duplicate_routes_id' => $routeIDs
460
-            ],
461
-        ]);
462
-
463
-        return $result;
464
-    }
465
-
466
-    public function resequenceRoute($params)
467
-    {
468
-        $allQueryFields = ['route_id', 'route_destination_id'];
469
-        $allBodyFields = ['addresses'];
470
-
471
-        $result = Route4Me::makeRequst([
472
-            'url'       => Endpoint::ROUTE_V4,
473
-            'method'    => 'PUT',
474
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
475
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
476
-        ]);
477
-
478
-        return $result;
479
-    }
480
-
481
-    /**
482
-     * @deprecated 'The method is obsolete, use the method ReoptimizeRoute instead.'
483
-     * @param $params
484
-     * @return mixed|string
485
-     */
486
-    public function resequenceAllAddresses($params)
487
-    {
488
-        $allQueryFields = ['route_id', 'disable_optimization', 'optimize'];
489
-
490
-        $result = Route4Me::makeRequst([
491
-            'url'       => Endpoint::REOPTIMIZE_V3_2,
492
-            'method'    => 'GET',
493
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
494
-        ]);
495
-
496
-        return $result;
497
-    }
498
-
499
-    /**
500
-     * Reoptimize a route
501
-     * @param $params type Route
502
-     * @return mixed|string
503
-     * @throws Exception\ApiError
504
-     */
505
-    public function reoptimizeRoute($params)
506
-    {
507
-        $allQueryFields = ['route_id', 'reoptimize', 'remaining', 'device_type'];
508
-
509
-        $result = Route4Me::makeRequst([
510
-            'url'       => Endpoint::ROUTE_V4,
511
-            'method'    => 'PUT',
512
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
513
-        ]);
514
-
515
-        return $result;
516
-    }
517
-
518
-    /**
519
-     * Merges the routes
520
-     * @param $params array contains:
521
-     * @param route_ids IDs of the routes to be merged.
522
-     * @param depot_address a depot address of the merged route.
523
-     * @param remove_origin if true, the origin routes will be removed.
524
-     * @param depot_lat the depot's latitude
525
-     * @param depot_lng the depot's longitude
526
-     * @return Status response
527
-     * @throws Exception\ApiError
528
-     */
529
-    public function mergeRoutes($params)
530
-    {
531
-        $allBodyFields = ['route_ids', 'depot_address', 'remove_origin', 'depot_lat',  'depot_lng'];
532
-
533
-        $result = Route4Me::makeRequst([
534
-            'url'           => Endpoint::ROUTES_MERGE,
535
-            'method'        => 'POST',
536
-            'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
537
-            'HTTPHEADER'    => 'Content-Type: multipart/form-data',
538
-        ]);
539
-
540
-        return $result;
541
-    }
542
-
543
-    /**
544
-     * Share a route by an email
545
-     * @param $params RouteParametersQuery contains:
546
-     * @param route_id a route ID to be shared.
547
-     * @param response_format the response format.
548
-     * @param recipient_email Recipient email.
549
-     * @return Status response
550
-     * @throws Exception\ApiError
551
-     */
552
-    public function shareRoute($params)
553
-    {
554
-        $allQueryFields = ['route_id', 'response_format'];
555
-        $allBodyFields = ['recipient_email'];
556
-
557
-        $result = Route4Me::makeRequst([
558
-            'url'           => Endpoint::ROUTE_SHARE,
559
-            'method'        => 'POST',
560
-            'query'         => Route4Me::generateRequestParameters($allQueryFields, $params),
561
-            'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
562
-            'HTTPHEADER'    => 'Content-Type: multipart/form-data',
563
-        ]);
564
-
565
-        return $result;
566
-    }
567
-
568
-    /**
569
-     * Returns random route_id from existing routes between $offset and $offset+$limit
570
-     * @param $offset integer The page number for route listing pagination.
571
-     * @param $limit integer The maximum number of the returned routes.
572
-     * @return string random route ID
573
-     * @throws Exception\ApiError
574
-     */
575
-    public function getRandomRouteId($offset, $limit)
576
-    {
577
-        $params = [
578
-            'offset'    => !is_null($offset) ? $offset : 0,
579
-            'limit'     => !is_null($limit) ? $limit : 30,
580
-        ];
581
-
582
-        $route = new self();
583
-        $routes = $route->getRoutes($params);
584
-
585
-        if (is_null($routes) || sizeof($routes) < 1) {
586
-            echo '<br> There are no routes in the account. Please, create the routes first. <br>';
587
-
588
-            return null;
589
-        }
590
-
591
-        $randomIndex = rand(0, sizeof($routes) - 1);
592
-
593
-        return $routes[$randomIndex]->route_id;
594
-    }
595
-
596
-    /**
597
-     * Update a route
598
-     * @param $params array contains:
599
-     * @param route_id string : route ID
600
-     * @param reoptimize int : if equal to 1 the route re-optimized.
601
-     * @param route_destination_id int : route destination ID
602
-     * @param addresses Address[] : an array of a route addresses.
603
-     * @param parameters RouteParameters : route parameters.
604
-     * @param unlink_from_master_optimization  Boolean : if true, the route will be unlinked from optimization.
605
-     * @return Route updated route
606
-     * @throws Exception\ApiError
607
-     */
608
-    public function updateRoute($params)
609
-    {
610
-        $allQueryFields = ['route_id', 'reoptimize','route_destination_id'];
611
-        $allBodyFields = ['addresses', 'parameters', 'unlink_from_master_optimization'];
612
-
613
-        $result = Route4Me::makeRequst([
614
-            'url'       => Endpoint::ROUTE_V4,
615
-            'method'    => 'PUT',
616
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
617
-            'body'      => (isset($params['addresses']) || isset($params['parameters']) || isset($params['unlink_from_master_optimization']))
618
-                            ? Route4Me::generateRequestParameters($allBodyFields, $params)
619
-                            : null,
620
-        ]);
621
-
622
-        return $result;
623
-    }
624
-
625
-    public function update()
626
-    {
627
-        $route = Route4Me::makeRequst([
628
-            'url'    => Endpoint::ROUTE_V4,
629
-            'method' => 'PUT',
630
-            'query'  => [
631
-                'route_id' => isset($this->route_id) ? $this->route_id : null,
632
-            ],
633
-            'body'   => [
634
-                'parameters' => $this->parameters,
635
-                ],
636
-            'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
637
-        ]);
638
-
639
-        return self::fromArray($route);
640
-    }
641
-
642
-    public function updateAddress($address = null)
643
-    {
644
-        $body = sizeof($this->addresses) < 1 ? get_object_vars($this->parameters)
645
-            : (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters));
646
-
647
-        $result = Route4Me::makeRequst([
648
-            'url'    => Endpoint::ADDRESS_V4,
649
-            'method' => 'PUT',
650
-            'query'  => [
651
-                'route_id' => isset($this->route_id) ? $this->route_id : null,
652
-                'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
653
-            ],
654
-            'body'   => $body,
655
-            'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
656
-        ]);
657
-
658
-        return $result;
659
-    }
660
-
661
-    public function updateRouteAddress()
662
-    {
663
-        $result = Route4Me::makeRequst([
664
-            'url'    => Endpoint::ADDRESS_V4,
665
-            'method' => 'PUT',
666
-            'query'  => [
667
-                'route_id' => isset($this->route_id) ? $this->route_id : null,
668
-                'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
669
-            ],
670
-            'body'   => [
671
-                'parameters' => isset($this->parameters) ? get_object_vars($this->parameters) : null,
672
-                'addresses' => isset($this->addresses) ? $this->addresses : null,
673
-            ],
674
-            'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
675
-        ]);
676
-
677
-        return $result;
678
-    }
679
-
680
-    public function addAddresses($params)
681
-    {
682
-        $allQueryFields = ['route_id'];
683
-        $allBodyFields = ['addresses'];
684
-
685
-        $route = Route4Me::makeRequst([
686
-            'url'           => Endpoint::ROUTE_V4,
687
-            'method'        => 'PUT',
688
-            'query'         => Route4Me::generateRequestParameters($allQueryFields, $params),
689
-            'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
690
-            'HTTPHEADER'    => isset($this->httpheaders) ? $this->httpheaders : null,
691
-        ]);
692
-
693
-        return self::fromArray($route);
694
-    }
695
-
696
-    public function insertAddressOptimalPosition(array $params)
697
-    {
698
-        $allQueryFields = ['route_id'];
699
-        $allBodyFields = ['addresses', 'optimal_position'];
700
-
701
-        $route = Route4Me::makeRequst([
702
-            'url'    => Endpoint::ROUTE_V4,
703
-            'method' => 'PUT',
704
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
705
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
706
-        ]);
707
-
708
-        return self::fromArray($route);
709
-    }
710
-
711
-    public function addNoteFile($params)
712
-    {
713
-        $fname = isset($params['strFilename']) ? $params['strFilename'] : null;
714
-        $rpath = realpath($fname);
715
-
716
-        $allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'];
717
-        $allBodyFields = ['strUpdateType', 'strFilename', 'strNoteContents'];
718
-
719
-        $result = Route4Me::makeRequst([
720
-            'url'    => Endpoint::ROUTE_NOTES_ADD,
721
-            'method' => 'POST',
722
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
723
-            'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
724
-            'FILE'   => $rpath,
725
-            'HTTPHEADER' => [
726
-                'Content-Type: application/x-www-form-urlencoded',
727
-            ],
728
-        ]);
729
-
730
-        return $result;
731
-    }
732
-
733
-    public function deleteRoutes($route_id)
734
-    {
735
-        $result = Route4Me::makeRequst([
736
-            'url'    => Endpoint::ROUTE_V4,
737
-            'method' => 'DELETE',
738
-            'query'  => [
739
-                'route_id' => $route_id,
740
-            ],
741
-        ]);
742
-
743
-        return $result;
744
-    }
745
-
746
-    public function GetAddressesFromRoute($route_id)
747
-    {
748
-        $route1 = self::getRoutes(['route_id' => $route_id]);
749
-
750
-        if (isset($route1)) {
751
-            return $route1->addresses;
752
-        } else {
753
-            return null;
754
-        }
755
-    }
756
-
757
-    public function GetRandomAddressFromRoute($route_id)
758
-    {
759
-        $route1 = self::getRoutes(['route_id' => $route_id]);
760
-
761
-        if (isset($route1)) {
762
-            $addresses = $route1->addresses;
763
-
764
-            $rnd = rand(0, sizeof($addresses) - 1);
765
-
766
-            return $addresses[$rnd];
767
-        } else {
768
-            return null;
769
-        }
770
-    }
771
-
772
-    public function getRouteId()
773
-    {
774
-        return $this->route_id;
775
-    }
776
-
777
-    public function getOptimizationId()
778
-    {
779
-        return $this->optimization_problem_id;
780
-    }
781
-
782
-    public function GetLastLocation(array $params)
783
-    {
784
-        $allQueryFields = ['route_id', 'device_tracking_history'];
785
-
786
-        $route = Route4Me::makeRequst([
787
-            'url'    => Endpoint::ROUTE_V4,
788
-            'method' => 'GET',
789
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
790
-        ]);
791
-
792
-        return self::fromArray($route);
793
-    }
794
-
795
-    public function GetTrackingHistoryFromTimeRange(array $params)
796
-    {
797
-        $allQueryFields = ['route_id', 'format', 'time_period', 'start_date', 'end_date'];
798
-
799
-        $route = Route4Me::makeRequst([
800
-            'url'    => Endpoint::GET_DEVICE_LOCATION,
801
-            'method' => 'GET',
802
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
803
-        ]);
804
-
805
-        return $route;
806
-    }
807
-
808
-    public function GetAssetTracking(array $params)
809
-    {
810
-        $allQueryFields = ['tracking'];
811
-
812
-        $assetResponse = Route4Me::makeRequst([
813
-            'url'    => Endpoint::STATUS_V4,
814
-            'method' => 'GET',
815
-            'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
816
-        ]);
817
-
818
-        return $assetResponse;
819
-    }
15
+	/**
16
+	 * The route ID
17
+	 * @var string
18
+	 */
19
+	public $route_id;
20
+
21
+	/**
22
+	 * Member ID of a route owner
23
+	 * @var integer
24
+	 */
25
+	public $member_id;
26
+
27
+	/**
28
+	 * Optimization problem ID
29
+	 * @var string
30
+	 */
31
+	public $optimization_problem_id;
32
+
33
+	/**
34
+	 * Vehicle alias
35
+	 * @var string
36
+	 */
37
+	public $vehicle_alias;
38
+
39
+	/**
40
+	 * Driver alias
41
+	 * @var string
42
+	 */
43
+	public $driver_alias;
44
+
45
+	/**
46
+	 * Total route's trip distance
47
+	 * @var double
48
+	 */
49
+	public $trip_distance;
50
+
51
+	/**
52
+	 * The UDU distance measurement unit for the route.<br>
53
+	 * @note km or mi, the route4me api will convert all distance measurements into these units.
54
+	 * @var string
55
+	 */
56
+	public $udu_distance_unit;
57
+
58
+	/**
59
+	 * Total route's UDU trip distance
60
+	 * @var double
61
+	 */
62
+	public $udu_trip_distance;
63
+
64
+	/** Miles per gallon
65
+	 * @var double
66
+	 */
67
+	public $mpg;
68
+
69
+	/**
70
+	 * Gas price
71
+	 * @var double
72
+	 */
73
+	public $gas_price;
74
+
75
+	/**
76
+	 * Total route duration (seconds)
77
+	 * @var integer
78
+	 */
79
+	public $route_duration_sec;
80
+
81
+	/**
82
+	 * Number of the destinations in the route.
83
+	 * @var integer
84
+	 */
85
+	public $destination_count;
86
+
87
+	/**
88
+	 * Notes count in the route.
89
+	 * @var integer
90
+	 */
91
+	public $notes_count;
92
+
93
+	/**
94
+	 * Route parameters
95
+	 * @var RouteParameters
96
+	 */
97
+	public $parameters;
98
+
99
+	/**
100
+	 * An array of the route addresses
101
+	 * @var Address[]
102
+	 */
103
+	public $addresses = [];
104
+
105
+	/**
106
+	 * An array of the links
107
+	 * @var string[]
108
+	 */
109
+	public $links = [];
110
+
111
+	/**
112
+	 * Edge by edge turn-by-turn directions.
113
+	 * @var Direction[]
114
+	 */
115
+	public $directions = [];
116
+
117
+	/**
118
+	 * Edge-wise path to be drawn on the map.
119
+	 * @var GeoPoint[]
120
+	 */
121
+	public $path = [];
122
+
123
+	/**
124
+	 * A collection of device tracking data with coordinates, speed, and timestamps.
125
+	 * @var Tracking\TrackingHistory[]
126
+	 */
127
+	public $tracking_history = [];
128
+
129
+	/**
130
+	 * HTTP headers
131
+	 * @var string
132
+	 */
133
+	public $httpheaders;
134
+
135
+	/**
136
+	 * If true, the route is unrouted.
137
+	 * @var Boolean
138
+	 */
139
+	public $is_unrouted;
140
+
141
+	/**
142
+	 * User route rating [0, 5]. A null value means no rating was given.<br>
143
+	 * Users can rate routes so that future optimizations take these ratings into account.
144
+	 * @var integer
145
+	 */
146
+	public $user_route_rating;
147
+
148
+	/**
149
+	 * The member's email
150
+	 * @var string
151
+	 */
152
+	public $member_email;
153
+
154
+	/**
155
+	 * URL to a member picture
156
+	 * @var string
157
+	 */
158
+	public $member_picture;
159
+
160
+	/**
161
+	 * Member tracking subheadline.
162
+	 * @var string
163
+	 */
164
+	public $member_tracking_subheadline;
165
+
166
+	/**
167
+	 * If true, the order is approved for execution.
168
+	 * @var Boolean
169
+	 */
170
+	public $approved_for_execution;
171
+
172
+	/**
173
+	 * Counter of the approved revisions.
174
+	 * @var integer
175
+	 */
176
+	public $approved_revisions_counter;
177
+
178
+	/**
179
+	 * The member's first name.
180
+	 * @var string
181
+	 */
182
+	public $member_first_name;
183
+
184
+	/**
185
+	 * The member's last name.
186
+	 * @var string
187
+	 */
188
+	public $member_last_name;
189
+
190
+	/**
191
+	 * Channel name
192
+	 * @var string
193
+	 */
194
+	public $channel_name;
195
+
196
+	/**
197
+	 * Total cost of the route.
198
+	 * @var double
199
+	 */
200
+	public $route_cost;
201
+
202
+	/**
203
+	 * Total route revenue
204
+	 * @var double
205
+	 */
206
+	public $route_revenue;
207
+
208
+	/**
209
+	 * Net revenue per distance unit.
210
+	 * @var double
211
+	 */
212
+	public $net_revenue_per_distance_unit;
213
+
214
+	/**
215
+	 * When route created (UNIX format timestamp).
216
+	 * @var integer
217
+	 */
218
+	public $created_timestamp;
219
+
220
+	/**
221
+	 * Planned total route duration (seconds).
222
+	 * @var integer
223
+	 */
224
+	public $planned_total_route_duration;
225
+
226
+	/**
227
+	 * Total wait time (seconds).
228
+	 * @var integer
229
+	 */
230
+	public $total_wait_time;
231
+
232
+	/**
233
+	 * UDU Actual travel distance.
234
+	 * @var double
235
+	 */
236
+	public $udu_actual_travel_distance;
237
+
238
+	/**
239
+	 * Actual travel distance.
240
+	 * @var double
241
+	 */
242
+	public $actual_travel_distance;
243
+
244
+	/**
245
+	 * Actual travel time (seconds).
246
+	 * @var integer
247
+	 */
248
+	public $actual_travel_time;
249
+
250
+	/**
251
+	 * Actual footsteps.
252
+	 * @var integer
253
+	 */
254
+	public $actual_footsteps;
255
+
256
+	/**
257
+	 * Working time.
258
+	 * @var integer
259
+	 */
260
+	public $working_time;
261
+
262
+	/**
263
+	 * Driving time.
264
+	 * @var integer
265
+	 */
266
+	public $driving_time;
267
+
268
+	/**
269
+	 * Idling time.
270
+	 * @var integer
271
+	 */
272
+	public $idling_time;
273
+
274
+	/**
275
+	 * Paying miles
276
+	 * @var double
277
+	 */
278
+	public $paying_miles;
279
+
280
+	/**
281
+	 * Geofence polygon type.<br>
282
+	 * enum: ["circle", "poly", "rect"]
283
+	 * @var string
284
+	 */
285
+	public $geofence_polygon_type;
286
+
287
+	/**
288
+	 * Geofence polygon size.
289
+	 * @var integer
290
+	 */
291
+	public $geofence_polygon_size;
292
+
293
+	/**
294
+	 * Route notes
295
+	 * @var AddressNote[]
296
+	 */
297
+	public $notes=[];
298
+
299
+	/**
300
+	 * A vehicle assigned to the route.
301
+	 * @var Vehicles\VehicleResponseV4
302
+	 */
303
+	public $vehicle=[];
304
+
305
+	/**
306
+	 * Member config key-value pairs.
307
+	 * @var array
308
+	 */
309
+	public $member_config_storage;
310
+
311
+	/**
312
+	 * Original route
313
+	 * @var Route
314
+	 */
315
+	public $original_route;
316
+
317
+	/**
318
+	 * If true, the route will be unlinked from the master optimization.
319
+	 * @var Boolean
320
+	 */
321
+	public $unlink_from_master_optimization;
322
+
323
+	public function __construct()
324
+	{
325
+		Route4Me::setBaseUrl(Endpoint::BASE_URL);
326
+	}
327
+
328
+	public static function fromArray(array $params)
329
+	{
330
+		$route = new self();
331
+		$route->route_id = Common::getValue($params, 'route_id');
332
+		$route->member_id = Common::getValue($params, 'member_id');
333
+		$route->member_email = Common::getValue($params, 'member_email');
334
+		$route->member_picture = Common::getValue($params, 'member_picture');
335
+		$route->member_tracking_subheadline = Common::getValue($params, 'member_tracking_subheadline');
336
+		$route->approved_for_execution = Common::getValue($params, 'approved_for_execution');
337
+		$route->approved_revisions_counter = Common::getValue($params, 'approved_revisions_counter');
338
+		$route->member_first_name = Common::getValue($params, 'member_first_name');
339
+		$route->member_last_name = Common::getValue($params, 'member_last_name');
340
+		$route->channel_name = Common::getValue($params, 'channel_name');
341
+		$route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id');
342
+		$route->user_route_rating = Common::getValue($params, 'user_route_rating');
343
+		$route->vehicle_alias = Common::getValue($params, 'vehicle_alias');
344
+		$route->driver_alias = Common::getValue($params, 'driver_alias');
345
+		$route->trip_distance = Common::getValue($params, 'trip_distance');
346
+		$route->udu_distance_unit = Common::getValue($params, 'udu_distance_unit');
347
+		$route->udu_trip_distance = Common::getValue($params, 'udu_trip_distance');
348
+		$route->mpg = Common::getValue($params, 'mpg');
349
+		$route->gas_price = Common::getValue($params, 'gas_price');
350
+		$route->route_duration_sec = Common::getvalue($params, 'route_duration_sec');
351
+		$route->planned_total_route_duration = Common::getvalue($params, 'planned_total_route_duration');
352
+		$route->total_wait_time = Common::getvalue($params, 'total_wait_time');
353
+		$route->udu_actual_travel_distance = Common::getvalue($params, 'udu_actual_travel_distance');
354
+		$route->actual_travel_distance = Common::getvalue($params, 'actual_travel_distance');
355
+		$route->actual_travel_time = Common::getvalue($params, 'actual_travel_time');
356
+		$route->actual_footsteps = Common::getvalue($params, 'actual_footsteps');
357
+		$route->working_time = Common::getvalue($params, 'working_time');
358
+		$route->driving_time = Common::getvalue($params, 'driving_time');
359
+		$route->idling_time = Common::getvalue($params, 'idling_time');
360
+		$route->paying_miles = Common::getvalue($params, 'paying_miles');
361
+		$route->geofence_polygon_type = Common::getvalue($params, 'geofence_polygon_type');
362
+		$route->geofence_polygon_size = Common::getvalue($params, 'geofence_polygon_size');
363
+		$route->destination_count = Common::getvalue($params, 'destination_count');
364
+		$route->notes_count = Common::getvalue($params, 'notes_count');
365
+		$route->is_unrouted = Common::getvalue($params, 'is_unrouted');
366
+		$route->route_cost = Common::getvalue($params, 'route_cost');
367
+		$route->route_revenue = Common::getvalue($params, 'route_revenue');
368
+		$route->net_revenue_per_distance_unit = Common::getvalue($params, 'net_revenue_per_distance_unit');
369
+		$route->created_timestamp = Common::getvalue($params, 'created_timestamp');
370
+
371
+		if (isset($params['vehicle'])) {
372
+			$route->vehicle = new Vehicle();
373
+			$route->vehicle = Vehicle::fromArray($params['vehicle']);
374
+			Route4Me::setBaseUrl(Endpoint::BASE_URL);
375
+		};
376
+
377
+		$route->member_config_storage = Common::getvalue($params, 'member_config_storage');
378
+
379
+		// Make RouteParameters
380
+		if (isset($params['parameters'])) {
381
+			$route->parameters = new RouteParameters();
382
+			$route->parameters = RouteParameters::fromArray($params['parameters']);
383
+			Route4Me::setBaseUrl(Endpoint::BASE_URL);
384
+		}
385
+
386
+		if (isset($params['addresses'])) {
387
+			$addresses = [];
388
+
389
+			foreach ($params['addresses'] as $address) {
390
+				$addresses[] = Address::fromArray($address);
391
+			}
392
+
393
+			$route->addresses = $addresses;
394
+		}
395
+
396
+		$route->links = Common::getValue($params, 'links', []);
397
+		$route->notes = Common::getValue($params, 'notes', []);
398
+		$route->directions = Common::getValue($params, 'directions', []);
399
+		$route->path = Common::getValue($params, 'path', []);
400
+		$route->tracking_history = Common::getValue($params, 'tracking_history', []);
401
+
402
+		if (isset($params['original_route'])) {
403
+			$route->original_route = Route::fromArray($params['original_route']);
404
+		};
405
+
406
+		return $route;
407
+	}
408
+
409
+	/**
410
+	 * @param RouteParametersQuery $params
411
+	 * @return An array of the routes
412
+	 * @throws Exception\ApiError
413
+	 */
414
+	public static function getRoutes($params = null)
415
+	{
416
+		$allQueryFields = ['route_id', 'original', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset','start_date','end_date'];
417
+
418
+		$result = Route4Me::makeRequst([
419
+			'url'       => Endpoint::ROUTE_V4,
420
+			'method'    => 'GET',
421
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
422
+		]);
423
+
424
+		if (isset($params['route_id'])) {
425
+			if (strlen($params['route_id'])==32) {
426
+				return self::fromArray($result);
427
+			} else {
428
+				return $result;
429
+			}
430
+		} else {
431
+			$routes = [];
432
+			foreach ($result as $route) {
433
+				$routes[] = self::fromArray($route);
434
+			}
435
+
436
+			return $routes;
437
+		}
438
+	}
439
+
440
+	public function getRoutePoints($params)
441
+	{
442
+		$allQueryFields = ['route_id', 'route_path_output', 'compress_path_points', 'directions'];
443
+
444
+		$result = Route4Me::makeRequst([
445
+			'url'    => Endpoint::ROUTE_V4,
446
+			'method' => 'GET',
447
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
448
+		]);
449
+
450
+		return $result;
451
+	}
452
+
453
+	public function duplicateRoute($routeIDs)
454
+	{
455
+		$result = Route4Me::makeRequst([
456
+			'url'    => Endpoint::ROUTE_V4,
457
+			'method' => 'POST',
458
+			'body'   => [
459
+				'duplicate_routes_id' => $routeIDs
460
+			],
461
+		]);
462
+
463
+		return $result;
464
+	}
465
+
466
+	public function resequenceRoute($params)
467
+	{
468
+		$allQueryFields = ['route_id', 'route_destination_id'];
469
+		$allBodyFields = ['addresses'];
470
+
471
+		$result = Route4Me::makeRequst([
472
+			'url'       => Endpoint::ROUTE_V4,
473
+			'method'    => 'PUT',
474
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
475
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
476
+		]);
477
+
478
+		return $result;
479
+	}
480
+
481
+	/**
482
+	 * @deprecated 'The method is obsolete, use the method ReoptimizeRoute instead.'
483
+	 * @param $params
484
+	 * @return mixed|string
485
+	 */
486
+	public function resequenceAllAddresses($params)
487
+	{
488
+		$allQueryFields = ['route_id', 'disable_optimization', 'optimize'];
489
+
490
+		$result = Route4Me::makeRequst([
491
+			'url'       => Endpoint::REOPTIMIZE_V3_2,
492
+			'method'    => 'GET',
493
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
494
+		]);
495
+
496
+		return $result;
497
+	}
498
+
499
+	/**
500
+	 * Reoptimize a route
501
+	 * @param $params type Route
502
+	 * @return mixed|string
503
+	 * @throws Exception\ApiError
504
+	 */
505
+	public function reoptimizeRoute($params)
506
+	{
507
+		$allQueryFields = ['route_id', 'reoptimize', 'remaining', 'device_type'];
508
+
509
+		$result = Route4Me::makeRequst([
510
+			'url'       => Endpoint::ROUTE_V4,
511
+			'method'    => 'PUT',
512
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
513
+		]);
514
+
515
+		return $result;
516
+	}
517
+
518
+	/**
519
+	 * Merges the routes
520
+	 * @param $params array contains:
521
+	 * @param route_ids IDs of the routes to be merged.
522
+	 * @param depot_address a depot address of the merged route.
523
+	 * @param remove_origin if true, the origin routes will be removed.
524
+	 * @param depot_lat the depot's latitude
525
+	 * @param depot_lng the depot's longitude
526
+	 * @return Status response
527
+	 * @throws Exception\ApiError
528
+	 */
529
+	public function mergeRoutes($params)
530
+	{
531
+		$allBodyFields = ['route_ids', 'depot_address', 'remove_origin', 'depot_lat',  'depot_lng'];
532
+
533
+		$result = Route4Me::makeRequst([
534
+			'url'           => Endpoint::ROUTES_MERGE,
535
+			'method'        => 'POST',
536
+			'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
537
+			'HTTPHEADER'    => 'Content-Type: multipart/form-data',
538
+		]);
539
+
540
+		return $result;
541
+	}
542
+
543
+	/**
544
+	 * Share a route by an email
545
+	 * @param $params RouteParametersQuery contains:
546
+	 * @param route_id a route ID to be shared.
547
+	 * @param response_format the response format.
548
+	 * @param recipient_email Recipient email.
549
+	 * @return Status response
550
+	 * @throws Exception\ApiError
551
+	 */
552
+	public function shareRoute($params)
553
+	{
554
+		$allQueryFields = ['route_id', 'response_format'];
555
+		$allBodyFields = ['recipient_email'];
556
+
557
+		$result = Route4Me::makeRequst([
558
+			'url'           => Endpoint::ROUTE_SHARE,
559
+			'method'        => 'POST',
560
+			'query'         => Route4Me::generateRequestParameters($allQueryFields, $params),
561
+			'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
562
+			'HTTPHEADER'    => 'Content-Type: multipart/form-data',
563
+		]);
564
+
565
+		return $result;
566
+	}
567
+
568
+	/**
569
+	 * Returns random route_id from existing routes between $offset and $offset+$limit
570
+	 * @param $offset integer The page number for route listing pagination.
571
+	 * @param $limit integer The maximum number of the returned routes.
572
+	 * @return string random route ID
573
+	 * @throws Exception\ApiError
574
+	 */
575
+	public function getRandomRouteId($offset, $limit)
576
+	{
577
+		$params = [
578
+			'offset'    => !is_null($offset) ? $offset : 0,
579
+			'limit'     => !is_null($limit) ? $limit : 30,
580
+		];
581
+
582
+		$route = new self();
583
+		$routes = $route->getRoutes($params);
584
+
585
+		if (is_null($routes) || sizeof($routes) < 1) {
586
+			echo '<br> There are no routes in the account. Please, create the routes first. <br>';
587
+
588
+			return null;
589
+		}
590
+
591
+		$randomIndex = rand(0, sizeof($routes) - 1);
592
+
593
+		return $routes[$randomIndex]->route_id;
594
+	}
595
+
596
+	/**
597
+	 * Update a route
598
+	 * @param $params array contains:
599
+	 * @param route_id string : route ID
600
+	 * @param reoptimize int : if equal to 1 the route re-optimized.
601
+	 * @param route_destination_id int : route destination ID
602
+	 * @param addresses Address[] : an array of a route addresses.
603
+	 * @param parameters RouteParameters : route parameters.
604
+	 * @param unlink_from_master_optimization  Boolean : if true, the route will be unlinked from optimization.
605
+	 * @return Route updated route
606
+	 * @throws Exception\ApiError
607
+	 */
608
+	public function updateRoute($params)
609
+	{
610
+		$allQueryFields = ['route_id', 'reoptimize','route_destination_id'];
611
+		$allBodyFields = ['addresses', 'parameters', 'unlink_from_master_optimization'];
612
+
613
+		$result = Route4Me::makeRequst([
614
+			'url'       => Endpoint::ROUTE_V4,
615
+			'method'    => 'PUT',
616
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
617
+			'body'      => (isset($params['addresses']) || isset($params['parameters']) || isset($params['unlink_from_master_optimization']))
618
+							? Route4Me::generateRequestParameters($allBodyFields, $params)
619
+							: null,
620
+		]);
621
+
622
+		return $result;
623
+	}
624
+
625
+	public function update()
626
+	{
627
+		$route = Route4Me::makeRequst([
628
+			'url'    => Endpoint::ROUTE_V4,
629
+			'method' => 'PUT',
630
+			'query'  => [
631
+				'route_id' => isset($this->route_id) ? $this->route_id : null,
632
+			],
633
+			'body'   => [
634
+				'parameters' => $this->parameters,
635
+				],
636
+			'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
637
+		]);
638
+
639
+		return self::fromArray($route);
640
+	}
641
+
642
+	public function updateAddress($address = null)
643
+	{
644
+		$body = sizeof($this->addresses) < 1 ? get_object_vars($this->parameters)
645
+			: (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters));
646
+
647
+		$result = Route4Me::makeRequst([
648
+			'url'    => Endpoint::ADDRESS_V4,
649
+			'method' => 'PUT',
650
+			'query'  => [
651
+				'route_id' => isset($this->route_id) ? $this->route_id : null,
652
+				'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
653
+			],
654
+			'body'   => $body,
655
+			'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
656
+		]);
657
+
658
+		return $result;
659
+	}
660
+
661
+	public function updateRouteAddress()
662
+	{
663
+		$result = Route4Me::makeRequst([
664
+			'url'    => Endpoint::ADDRESS_V4,
665
+			'method' => 'PUT',
666
+			'query'  => [
667
+				'route_id' => isset($this->route_id) ? $this->route_id : null,
668
+				'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null,
669
+			],
670
+			'body'   => [
671
+				'parameters' => isset($this->parameters) ? get_object_vars($this->parameters) : null,
672
+				'addresses' => isset($this->addresses) ? $this->addresses : null,
673
+			],
674
+			'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null,
675
+		]);
676
+
677
+		return $result;
678
+	}
679
+
680
+	public function addAddresses($params)
681
+	{
682
+		$allQueryFields = ['route_id'];
683
+		$allBodyFields = ['addresses'];
684
+
685
+		$route = Route4Me::makeRequst([
686
+			'url'           => Endpoint::ROUTE_V4,
687
+			'method'        => 'PUT',
688
+			'query'         => Route4Me::generateRequestParameters($allQueryFields, $params),
689
+			'body'          => Route4Me::generateRequestParameters($allBodyFields, $params),
690
+			'HTTPHEADER'    => isset($this->httpheaders) ? $this->httpheaders : null,
691
+		]);
692
+
693
+		return self::fromArray($route);
694
+	}
695
+
696
+	public function insertAddressOptimalPosition(array $params)
697
+	{
698
+		$allQueryFields = ['route_id'];
699
+		$allBodyFields = ['addresses', 'optimal_position'];
700
+
701
+		$route = Route4Me::makeRequst([
702
+			'url'    => Endpoint::ROUTE_V4,
703
+			'method' => 'PUT',
704
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
705
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
706
+		]);
707
+
708
+		return self::fromArray($route);
709
+	}
710
+
711
+	public function addNoteFile($params)
712
+	{
713
+		$fname = isset($params['strFilename']) ? $params['strFilename'] : null;
714
+		$rpath = realpath($fname);
715
+
716
+		$allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'];
717
+		$allBodyFields = ['strUpdateType', 'strFilename', 'strNoteContents'];
718
+
719
+		$result = Route4Me::makeRequst([
720
+			'url'    => Endpoint::ROUTE_NOTES_ADD,
721
+			'method' => 'POST',
722
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
723
+			'body'   => Route4Me::generateRequestParameters($allBodyFields, $params),
724
+			'FILE'   => $rpath,
725
+			'HTTPHEADER' => [
726
+				'Content-Type: application/x-www-form-urlencoded',
727
+			],
728
+		]);
729
+
730
+		return $result;
731
+	}
732
+
733
+	public function deleteRoutes($route_id)
734
+	{
735
+		$result = Route4Me::makeRequst([
736
+			'url'    => Endpoint::ROUTE_V4,
737
+			'method' => 'DELETE',
738
+			'query'  => [
739
+				'route_id' => $route_id,
740
+			],
741
+		]);
742
+
743
+		return $result;
744
+	}
745
+
746
+	public function GetAddressesFromRoute($route_id)
747
+	{
748
+		$route1 = self::getRoutes(['route_id' => $route_id]);
749
+
750
+		if (isset($route1)) {
751
+			return $route1->addresses;
752
+		} else {
753
+			return null;
754
+		}
755
+	}
756
+
757
+	public function GetRandomAddressFromRoute($route_id)
758
+	{
759
+		$route1 = self::getRoutes(['route_id' => $route_id]);
760
+
761
+		if (isset($route1)) {
762
+			$addresses = $route1->addresses;
763
+
764
+			$rnd = rand(0, sizeof($addresses) - 1);
765
+
766
+			return $addresses[$rnd];
767
+		} else {
768
+			return null;
769
+		}
770
+	}
771
+
772
+	public function getRouteId()
773
+	{
774
+		return $this->route_id;
775
+	}
776
+
777
+	public function getOptimizationId()
778
+	{
779
+		return $this->optimization_problem_id;
780
+	}
781
+
782
+	public function GetLastLocation(array $params)
783
+	{
784
+		$allQueryFields = ['route_id', 'device_tracking_history'];
785
+
786
+		$route = Route4Me::makeRequst([
787
+			'url'    => Endpoint::ROUTE_V4,
788
+			'method' => 'GET',
789
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
790
+		]);
791
+
792
+		return self::fromArray($route);
793
+	}
794
+
795
+	public function GetTrackingHistoryFromTimeRange(array $params)
796
+	{
797
+		$allQueryFields = ['route_id', 'format', 'time_period', 'start_date', 'end_date'];
798
+
799
+		$route = Route4Me::makeRequst([
800
+			'url'    => Endpoint::GET_DEVICE_LOCATION,
801
+			'method' => 'GET',
802
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
803
+		]);
804
+
805
+		return $route;
806
+	}
807
+
808
+	public function GetAssetTracking(array $params)
809
+	{
810
+		$allQueryFields = ['tracking'];
811
+
812
+		$assetResponse = Route4Me::makeRequst([
813
+			'url'    => Endpoint::STATUS_V4,
814
+			'method' => 'GET',
815
+			'query'  => Route4Me::generateRequestParameters($allQueryFields, $params),
816
+		]);
817
+
818
+		return $assetResponse;
819
+	}
820 820
 }
Please login to merge, or discard this patch.
src/Route4Me/TelematicsGateway/TelematicsVendorsResponse.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
  */
10 10
 class TelematicsVendorsResponse 
11 11
 {
12
-    /**
13
-     * An array of the telematics vendors.
14
-     * @var type TelematicsVendors[]
15
-     */
16
-    public $vendors = [];
12
+	/**
13
+	 * An array of the telematics vendors.
14
+	 * @var type TelematicsVendors[]
15
+	 */
16
+	public $vendors = [];
17 17
 }
Please login to merge, or discard this patch.
src/Route4Me/TelematicsGateway/TelematicsVendorResponse.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
  */
9 9
 class TelematicsVendorResponse extends Common
10 10
 {
11
-    /**
12
-     * Telematics Vendor
13
-     * @var type TelematicsVendor
14
-     */
15
-    public $vendor;
11
+	/**
12
+	 * Telematics Vendor
13
+	 * @var type TelematicsVendor
14
+	 */
15
+	public $vendor;
16 16
 }
Please login to merge, or discard this patch.
src/Route4Me/Vehicles/VehiclesResponseV4.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -13,82 +13,82 @@
 block discarded – undo
13 13
  */
14 14
 class VehiclesResponseV4 extends \Route4Me\Common
15 15
 {
16
-    /** @var int $current_page
17
-     * Current page number in the driver reviews collection.
18
-     */
19
-    public $current_page;
20
-
21
-    /** @var VehicleV4[] $data
22
-     * An array of the vehicles data.
23
-     */
24
-    public $data = [];
25
-
26
-    /** @var string $first_page_url
27
-     * URL to the first page.
28
-     */
29
-    public $first_page_url;
30
-
31
-    /** @var int $from
32
-     * From which vehicle is starting the page.
33
-     */
34
-    public $from;
35
-
36
-    /** @var int $last_page
37
-     * Last page number in the vehicles collection.
38
-     */
39
-    public $last_page;
40
-
41
-    /** @var string $last_page_url
42
-     * URL to the last page.
43
-     */
44
-    public $last_page_url;
45
-
46
-    /** @var string $next_page_url
47
-     * URL to the next page.
48
-     */
49
-    public $next_page_url;
50
-
51
-    /** @var string $path
52
-     * Path to the API endpoint.
53
-     */
54
-    public $path;
55
-
56
-    /** @var int $per_page
57
-     * Vehicles number per page.
58
-     */
59
-    public $per_page;
60
-
61
-    /** @var string $prev_page_url
62
-     * URL to the previous page.
63
-     */
64
-    public $prev_page_url;
65
-
66
-    /** @var int $to
67
-     * To which vehicle is ending the page.
68
-     */
69
-    public $to;
70
-
71
-    /** @var int $total
72
-     * Total number of the vehicles.
73
-     */
74
-    public $total;
75
-
76
-    public function __construct()
77
-    {
78
-        Route4Me::setBaseUrl(Endpoint::WH_BASE_URL);
79
-    }
80
-
81
-    public static function fromArray(array $params)
82
-    {
83
-        $vehiclesResponse = new self();
84
-
85
-        foreach ($params as $key => $value) {
86
-            if (is_null(Common::getValue($params, $key))) continue;
87
-            if (property_exists($vehiclesResponse, $key)) {
88
-                $vehiclesResponse->$key = $value;
89
-            }
90
-        }
91
-
92
-        return $vehiclesResponse;
93
-    }
16
+	/** @var int $current_page
17
+	 * Current page number in the driver reviews collection.
18
+	 */
19
+	public $current_page;
20
+
21
+	/** @var VehicleV4[] $data
22
+	 * An array of the vehicles data.
23
+	 */
24
+	public $data = [];
25
+
26
+	/** @var string $first_page_url
27
+	 * URL to the first page.
28
+	 */
29
+	public $first_page_url;
30
+
31
+	/** @var int $from
32
+	 * From which vehicle is starting the page.
33
+	 */
34
+	public $from;
35
+
36
+	/** @var int $last_page
37
+	 * Last page number in the vehicles collection.
38
+	 */
39
+	public $last_page;
40
+
41
+	/** @var string $last_page_url
42
+	 * URL to the last page.
43
+	 */
44
+	public $last_page_url;
45
+
46
+	/** @var string $next_page_url
47
+	 * URL to the next page.
48
+	 */
49
+	public $next_page_url;
50
+
51
+	/** @var string $path
52
+	 * Path to the API endpoint.
53
+	 */
54
+	public $path;
55
+
56
+	/** @var int $per_page
57
+	 * Vehicles number per page.
58
+	 */
59
+	public $per_page;
60
+
61
+	/** @var string $prev_page_url
62
+	 * URL to the previous page.
63
+	 */
64
+	public $prev_page_url;
65
+
66
+	/** @var int $to
67
+	 * To which vehicle is ending the page.
68
+	 */
69
+	public $to;
70
+
71
+	/** @var int $total
72
+	 * Total number of the vehicles.
73
+	 */
74
+	public $total;
75
+
76
+	public function __construct()
77
+	{
78
+		Route4Me::setBaseUrl(Endpoint::WH_BASE_URL);
79
+	}
80
+
81
+	public static function fromArray(array $params)
82
+	{
83
+		$vehiclesResponse = new self();
84
+
85
+		foreach ($params as $key => $value) {
86
+			if (is_null(Common::getValue($params, $key))) continue;
87
+			if (property_exists($vehiclesResponse, $key)) {
88
+				$vehiclesResponse->$key = $value;
89
+			}
90
+		}
91
+
92
+		return $vehiclesResponse;
93
+	}
94 94
 }
95 95
\ No newline at end of file
Please login to merge, or discard this patch.