@@ -210,7 +210,7 @@ |
||
210 | 210 | { |
211 | 211 | sleep(5); |
212 | 212 | |
213 | - if (self::$created_guid !== null) { |
|
213 | + if (self::$created_guid!==null) { |
|
214 | 214 | $pod_workflows = new PodWorkflows(); |
215 | 215 | $pod_workflows->deletePodWorkflow(self::$created_guid); |
216 | 216 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function getPodWorkflow(string $workflow_guid) : ResponsePodWorkflow |
95 | 95 | { |
96 | 96 | return $this->toResponsePodWorkflow(Route4Me::makeRequst([ |
97 | - 'url' => Endpoint::POD_WORKFLOW . '/' . $workflow_guid, |
|
97 | + 'url' => Endpoint::POD_WORKFLOW.'/'.$workflow_guid, |
|
98 | 98 | 'method' => 'GET' |
99 | 99 | ])); |
100 | 100 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'title', 'done_actions', 'failed_actions']; |
117 | 117 | |
118 | 118 | return $this->toResponsePodWorkflow(Route4Me::makeRequst([ |
119 | - 'url' => Endpoint::POD_WORKFLOW . '/' . $workflow_guid, |
|
119 | + 'url' => Endpoint::POD_WORKFLOW.'/'.$workflow_guid, |
|
120 | 120 | 'method' => 'PUT', |
121 | 121 | 'HTTPHEADER' => 'Content-Type: application/json', |
122 | 122 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function deletePodWorkflow(string $workflow_guid) : bool |
136 | 136 | { |
137 | 137 | $res = Route4Me::makeRequst([ |
138 | - 'url' => Endpoint::POD_WORKFLOW . '/' . $workflow_guid, |
|
138 | + 'url' => Endpoint::POD_WORKFLOW.'/'.$workflow_guid, |
|
139 | 139 | 'method' => 'DELETE' |
140 | 140 | ]); |
141 | 141 | return isset($res); |
@@ -31,10 +31,10 @@ |
||
31 | 31 | |
32 | 32 | public function __construct(?array $params = null) |
33 | 33 | { |
34 | - if ($params !== null) { |
|
34 | + if ($params!==null) { |
|
35 | 35 | foreach ($this as $key => $value) { |
36 | 36 | if (isset($params[$key])) { |
37 | - if ($key === 'data') { |
|
37 | + if ($key==='data') { |
|
38 | 38 | $this->{$key} = array(); |
39 | 39 | foreach ($params[$key] as $pod_wf => $value) { |
40 | 40 | array_push($this->{$key}, new ResponsePodWorkflow($value)); |
@@ -61,10 +61,10 @@ |
||
61 | 61 | |
62 | 62 | public function __construct(?array $params = null) |
63 | 63 | { |
64 | - if ($params !== null) { |
|
64 | + if ($params!==null) { |
|
65 | 65 | foreach ($this as $key => $value) { |
66 | 66 | if (isset($params[$key])) { |
67 | - if ($key === 'done_actions' || $key === 'failed_actions') { |
|
67 | + if ($key==='done_actions' || $key==='failed_actions') { |
|
68 | 68 | $this->{$key} = array(); |
69 | 69 | foreach ($params[$key] as $action => $value) { |
70 | 70 | array_push($this->{$key}, new Action($value)); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | public function __construct(?array $params = null) |
37 | 37 | { |
38 | - if ($params !== null) { |
|
38 | + if ($params!==null) { |
|
39 | 39 | $this->fillFromArray($params); |
40 | 40 | } |
41 | 41 | } |
@@ -36,10 +36,10 @@ |
||
36 | 36 | |
37 | 37 | public function __construct(?array $params = null) |
38 | 38 | { |
39 | - if ($params !== null) { |
|
39 | + if ($params!==null) { |
|
40 | 40 | foreach ($this as $key => $value) { |
41 | 41 | if (isset($params[$key])) { |
42 | - if ($key === 'options') { |
|
42 | + if ($key==='options') { |
|
43 | 43 | $this->{$key} = array(); |
44 | 44 | foreach ($params[$key] as $option => $value) { |
45 | 45 | array_push($this->{$key}, new Option($value)); |
@@ -12,51 +12,51 @@ discard block |
||
12 | 12 | |
13 | 13 | // <editor-fold defaultstate="collapsed" desc="region Routes"> |
14 | 14 | |
15 | - const Routes = self::MAIN_HOST . "/routes"; |
|
16 | - const RoutesDuplicate = self::MAIN_HOST . "/routes/duplicate"; |
|
17 | - const RoutesMerge = self::MAIN_HOST . "/routes/merge"; |
|
18 | - const RoutesPaginate = self::MAIN_HOST . "/routes/paginate"; |
|
19 | - const RoutesFallbackPaginate = self::MAIN_HOST . "/routes/fallback/paginate"; |
|
20 | - const RoutesFallbackDatatable = self::MAIN_HOST . "/routes/fallback/datatable"; |
|
21 | - const RoutesFallback = self::MAIN_HOST . "/routes/fallback"; |
|
22 | - const RoutesReindexCallback = self::MAIN_HOST . "/routes/reindex-callback"; |
|
23 | - const RoutesDatatable = self::MAIN_HOST . "/routes/datatable"; |
|
24 | - const RoutesDatatableConfig = self::MAIN_HOST . "/routes/datatable/config"; |
|
25 | - const RoutesDatatableConfigFallback = self::MAIN_HOST . "/routes/fallback/datatable/config"; |
|
15 | + const Routes = self::MAIN_HOST."/routes"; |
|
16 | + const RoutesDuplicate = self::MAIN_HOST."/routes/duplicate"; |
|
17 | + const RoutesMerge = self::MAIN_HOST."/routes/merge"; |
|
18 | + const RoutesPaginate = self::MAIN_HOST."/routes/paginate"; |
|
19 | + const RoutesFallbackPaginate = self::MAIN_HOST."/routes/fallback/paginate"; |
|
20 | + const RoutesFallbackDatatable = self::MAIN_HOST."/routes/fallback/datatable"; |
|
21 | + const RoutesFallback = self::MAIN_HOST."/routes/fallback"; |
|
22 | + const RoutesReindexCallback = self::MAIN_HOST."/routes/reindex-callback"; |
|
23 | + const RoutesDatatable = self::MAIN_HOST."/routes/datatable"; |
|
24 | + const RoutesDatatableConfig = self::MAIN_HOST."/routes/datatable/config"; |
|
25 | + const RoutesDatatableConfigFallback = self::MAIN_HOST."/routes/fallback/datatable/config"; |
|
26 | 26 | |
27 | 27 | // </editor-fold> |
28 | 28 | |
29 | 29 | // <editor-fold defaultstate="collapsed" desc="Team Users"> |
30 | 30 | |
31 | - const TEAM_USERS = self::MAIN_HOST . "/team/users"; |
|
32 | - const TEAM_USERS_BULK_INSERT = self::MAIN_HOST . "/team/bulk-insert"; |
|
33 | - const DriverReview = self::MAIN_HOST . "/driver-reviews"; |
|
31 | + const TEAM_USERS = self::MAIN_HOST."/team/users"; |
|
32 | + const TEAM_USERS_BULK_INSERT = self::MAIN_HOST."/team/bulk-insert"; |
|
33 | + const DriverReview = self::MAIN_HOST."/driver-reviews"; |
|
34 | 34 | |
35 | 35 | // </editor-fold> |
36 | 36 | |
37 | - const ACCOUNT_PROFILE = self::MAIN_HOST . "/profile-api"; |
|
37 | + const ACCOUNT_PROFILE = self::MAIN_HOST."/profile-api"; |
|
38 | 38 | |
39 | 39 | // <editor-fold defaultstate="collapsed" desc="Vehicles"> |
40 | 40 | |
41 | - const Vehicles = self::MAIN_HOST . "/vehicles"; |
|
42 | - const VehicleTemporary = self::MAIN_HOST . "/vehicles/assign"; |
|
43 | - const VehicleExecuteOrder = self::MAIN_HOST . "/vehicles/execute"; |
|
44 | - const VehicleLocation = self::MAIN_HOST . "/vehicles/location"; |
|
45 | - const VehicleProfiles = self::MAIN_HOST . "/vehicle-profiles"; |
|
46 | - const VehicleLicense = self::MAIN_HOST . "/vehicles/license"; |
|
47 | - const VehicleSearch = self::MAIN_HOST . "/vehicles/search"; |
|
48 | - |
|
49 | - const RECURRING_ROUTES = self::MAIN_HOST . "/recurring-routes"; |
|
50 | - const RECURRING_ROUTES_SCHEDULES = self::MAIN_HOST . "/recurring-routes/schedules"; |
|
51 | - const RECURRING_ROUTES_SCHEDULES_PAGINATION = self::MAIN_HOST . "/recurring-routes/schedules/pagination"; |
|
52 | - const RECURRING_ROUTES_ROUTE_SCHEDULES = self::MAIN_HOST . "/recurring-routes/route-schedules"; |
|
41 | + const Vehicles = self::MAIN_HOST."/vehicles"; |
|
42 | + const VehicleTemporary = self::MAIN_HOST."/vehicles/assign"; |
|
43 | + const VehicleExecuteOrder = self::MAIN_HOST."/vehicles/execute"; |
|
44 | + const VehicleLocation = self::MAIN_HOST."/vehicles/location"; |
|
45 | + const VehicleProfiles = self::MAIN_HOST."/vehicle-profiles"; |
|
46 | + const VehicleLicense = self::MAIN_HOST."/vehicles/license"; |
|
47 | + const VehicleSearch = self::MAIN_HOST."/vehicles/search"; |
|
48 | + |
|
49 | + const RECURRING_ROUTES = self::MAIN_HOST."/recurring-routes"; |
|
50 | + const RECURRING_ROUTES_SCHEDULES = self::MAIN_HOST."/recurring-routes/schedules"; |
|
51 | + const RECURRING_ROUTES_SCHEDULES_PAGINATION = self::MAIN_HOST."/recurring-routes/schedules/pagination"; |
|
52 | + const RECURRING_ROUTES_ROUTE_SCHEDULES = self::MAIN_HOST."/recurring-routes/route-schedules"; |
|
53 | 53 | const RECURRING_ROUTES_ROUTE_SCHEDULES_PAGINATION = |
54 | - self::MAIN_HOST . "/recurring-routes/route-schedules/pagination"; |
|
55 | - const RECURRING_ROUTES_ROUTE_SCHEDULES_REPLACE = self::MAIN_HOST . "/recurring-routes/route-schedules/replace"; |
|
56 | - const RECURRING_ROUTES_SCHEDULED_ROUTES_IS_COPY = self::MAIN_HOST . "/recurring-routes/scheduled-routes/is-copy"; |
|
54 | + self::MAIN_HOST."/recurring-routes/route-schedules/pagination"; |
|
55 | + const RECURRING_ROUTES_ROUTE_SCHEDULES_REPLACE = self::MAIN_HOST."/recurring-routes/route-schedules/replace"; |
|
56 | + const RECURRING_ROUTES_SCHEDULED_ROUTES_IS_COPY = self::MAIN_HOST."/recurring-routes/scheduled-routes/is-copy"; |
|
57 | 57 | const RECURRING_ROUTES_SCHEDULED_ROUTES_GET_COPIES = |
58 | - self::MAIN_HOST . "/recurring-routes/scheduled-routes/get-copies"; |
|
59 | - const RECURRING_ROUTES_MASTER_ROUTES = self::MAIN_HOST . "/recurring-routes/master-routes"; |
|
58 | + self::MAIN_HOST."/recurring-routes/scheduled-routes/get-copies"; |
|
59 | + const RECURRING_ROUTES_MASTER_ROUTES = self::MAIN_HOST."/recurring-routes/master-routes"; |
|
60 | 60 | |
61 | 61 | // </editor-fold> |
62 | 62 | |
@@ -65,64 +65,64 @@ discard block |
||
65 | 65 | const STAGING_HOST = "https://virtserver.swaggerhub.com/Route4Me/telematics-gateway/1.0.0"; |
66 | 66 | |
67 | 67 | const TELEMATICS_CONNECTION = self::STAGING_HOST."/connections"; |
68 | - const TELEMATICS_CONNECTION_VEHICLES = self::STAGING_HOST . "/connections/{connection_token}/vehicles"; |
|
68 | + const TELEMATICS_CONNECTION_VEHICLES = self::STAGING_HOST."/connections/{connection_token}/vehicles"; |
|
69 | 69 | |
70 | - const TELEMATICS_ACCESS_TOKEN = self::STAGING_HOST . "/access-tokens"; |
|
71 | - const TELEMATICS_ACCESS_TOKEN_SCHEDULES = self::STAGING_HOST . "/access-token-schedules"; |
|
72 | - const TELEMATICS_ACCESS_TOKEN_SCHEDULE_ITEMS = self::STAGING_HOST . "/access-token-schedules/{schedule_id}/items"; |
|
70 | + const TELEMATICS_ACCESS_TOKEN = self::STAGING_HOST."/access-tokens"; |
|
71 | + const TELEMATICS_ACCESS_TOKEN_SCHEDULES = self::STAGING_HOST."/access-token-schedules"; |
|
72 | + const TELEMATICS_ACCESS_TOKEN_SCHEDULE_ITEMS = self::STAGING_HOST."/access-token-schedules/{schedule_id}/items"; |
|
73 | 73 | |
74 | - const TELEMATICS_VEHICLE_GROUPS = self::STAGING_HOST . "/vehicle-groups"; |
|
75 | - const TELEMATICS_VEHICLE_GROUPS_RELATION = self::STAGING_HOST . "/vehicle-groups/{vehicle_group_id}/{relation}"; |
|
76 | - const TELEMATICS_VEHICLES_RESLATION = self::STAGING_HOST . "/vehicles/{vehicle_id}/{relation}"; |
|
74 | + const TELEMATICS_VEHICLE_GROUPS = self::STAGING_HOST."/vehicle-groups"; |
|
75 | + const TELEMATICS_VEHICLE_GROUPS_RELATION = self::STAGING_HOST."/vehicle-groups/{vehicle_group_id}/{relation}"; |
|
76 | + const TELEMATICS_VEHICLES_RESLATION = self::STAGING_HOST."/vehicles/{vehicle_id}/{relation}"; |
|
77 | 77 | |
78 | - const TELEMATICS_INFO_MEMBERS = self::STAGING_HOST . "/info/members"; |
|
79 | - const TELEMATICS_INFO_VEHICLES = self::STAGING_HOST . "/info/vehicles"; |
|
80 | - const TELEMATICS_INFO_VEHICLE = self::STAGING_HOST . "/info/vehicle/{vehicle_id}/track"; |
|
81 | - const TELEMATICS_INFO_MODULES = self::STAGING_HOST . "/info/members"; |
|
78 | + const TELEMATICS_INFO_MEMBERS = self::STAGING_HOST."/info/members"; |
|
79 | + const TELEMATICS_INFO_VEHICLES = self::STAGING_HOST."/info/vehicles"; |
|
80 | + const TELEMATICS_INFO_VEHICLE = self::STAGING_HOST."/info/vehicle/{vehicle_id}/track"; |
|
81 | + const TELEMATICS_INFO_MODULES = self::STAGING_HOST."/info/members"; |
|
82 | 82 | |
83 | - const TELEMATICS_ADDRESSES = self::STAGING_HOST . "/addresses"; |
|
83 | + const TELEMATICS_ADDRESSES = self::STAGING_HOST."/addresses"; |
|
84 | 84 | |
85 | - const TELEMATICS_Errors = self::STAGING_HOST . "/errors"; |
|
85 | + const TELEMATICS_Errors = self::STAGING_HOST."/errors"; |
|
86 | 86 | |
87 | - const TELEMATICS_CUSTOMER_NOTIFICATIONS = self::STAGING_HOST . "/customers/{customer_id}/notifications"; |
|
88 | - const TELEMATICS_CUSTOMERS = self::STAGING_HOST . "/customers"; |
|
89 | - const TELEMATICS_CUSTOMER_ID = self::STAGING_HOST . "/customers/{customer_id}"; |
|
87 | + const TELEMATICS_CUSTOMER_NOTIFICATIONS = self::STAGING_HOST."/customers/{customer_id}/notifications"; |
|
88 | + const TELEMATICS_CUSTOMERS = self::STAGING_HOST."/customers"; |
|
89 | + const TELEMATICS_CUSTOMER_ID = self::STAGING_HOST."/customers/{customer_id}"; |
|
90 | 90 | |
91 | - const TELEMATICS_NOTIFICATION_SCHEDULE_ITEMS = self::STAGING_HOST . "/notification-schedules/{notification_schedule_id}/items"; |
|
92 | - const TELEMATICS_NOTIFICATION_SCHEDULES = self::STAGING_HOST . "/notification-schedules"; |
|
93 | - const TELEMATICS_NOTIFICATION_SCHEDULE_IS = self::STAGING_HOST . "/notification-schedules/{schedule_id}"; |
|
94 | - const TELEMATICS_ONETIME_NOTIFICATIONS = self::STAGING_HOST . "/one-time-notifications"; |
|
91 | + const TELEMATICS_NOTIFICATION_SCHEDULE_ITEMS = self::STAGING_HOST."/notification-schedules/{notification_schedule_id}/items"; |
|
92 | + const TELEMATICS_NOTIFICATION_SCHEDULES = self::STAGING_HOST."/notification-schedules"; |
|
93 | + const TELEMATICS_NOTIFICATION_SCHEDULE_IS = self::STAGING_HOST."/notification-schedules/{schedule_id}"; |
|
94 | + const TELEMATICS_ONETIME_NOTIFICATIONS = self::STAGING_HOST."/one-time-notifications"; |
|
95 | 95 | |
96 | 96 | const TELEMATICS_MEMBER = self::STAGING_HOST; |
97 | 97 | |
98 | - const TELEMATICS_MEMBER_MODULES = self::STAGING_HOST . "/user-activated-modules"; |
|
98 | + const TELEMATICS_MEMBER_MODULES = self::STAGING_HOST."/user-activated-modules"; |
|
99 | 99 | |
100 | - const TELEMATICS_MEMBER_MODULE_ID = self::STAGING_HOST . "/user-activated-modules/{module_id}"; |
|
101 | - const TELEMATICS_MEMBER_MODULE_VEHICLES = self::STAGING_HOST . "/user-activated-modules/{module_id}/vehicles"; |
|
102 | - const TELEMATICS_MEMBER_MODULE_VEHICLE_ID = self::STAGING_HOST . "/user-activated-modules/{module_id}/vehicles/{vehicle_id}"; |
|
100 | + const TELEMATICS_MEMBER_MODULE_ID = self::STAGING_HOST."/user-activated-modules/{module_id}"; |
|
101 | + const TELEMATICS_MEMBER_MODULE_VEHICLES = self::STAGING_HOST."/user-activated-modules/{module_id}/vehicles"; |
|
102 | + const TELEMATICS_MEMBER_MODULE_VEHICLE_ID = self::STAGING_HOST."/user-activated-modules/{module_id}/vehicles/{vehicle_id}"; |
|
103 | 103 | |
104 | - const TELEMATICS_VENDORS = self::STAGING_HOST . "/vendors"; |
|
105 | - const TELEMATICS_VENDOR_ID = self::STAGING_HOST . "/vendors/{vendor_id}"; |
|
104 | + const TELEMATICS_VENDORS = self::STAGING_HOST."/vendors"; |
|
105 | + const TELEMATICS_VENDOR_ID = self::STAGING_HOST."/vendors/{vendor_id}"; |
|
106 | 106 | |
107 | 107 | // </editor-fold> |
108 | 108 | |
109 | - const ADDRESSES = self::MAIN_HOST . "/address-book/addresses"; |
|
110 | - const ADDRESSES_BATCH_CREATE = self::MAIN_HOST . "/address-book/addresses/batch-create"; |
|
111 | - const ADDRESSES_INDEX_ALL = self::MAIN_HOST . "/address-book/addresses/index/all"; |
|
112 | - const ADDRESSES_INDEX_PAGINATION = self::MAIN_HOST . "/address-book/addresses/index/pagination"; |
|
113 | - const ADDRESSES_INDEX_CLUSTERING = self::MAIN_HOST . "/address-book/addresses/index/clustering"; |
|
114 | - const ADDRESSES_SHOW = self::MAIN_HOST . "/address-book/addresses/show"; |
|
115 | - const ADDRESSES_BATCH_UPDATE = self::MAIN_HOST . "/address-book/addresses/batch-update"; |
|
116 | - const ADDRESSES_UPDATE_BY_AREAS = self::MAIN_HOST . "/address-book/addresses/update-by-areas"; |
|
117 | - const ADDRESSES_DELETE = self::MAIN_HOST . "/address-book/addresses/delete"; |
|
118 | - const ADDRESSES_DELETE_BY_AREAS = self::MAIN_HOST . "/address-book/addresses/delete-by-areas"; |
|
119 | - const ADDRESSES_CUSTOM_FIELDS = self::MAIN_HOST . "/address-book/addresses/custom-fields"; |
|
120 | - const ADDRESSES_DEPOTS = self::MAIN_HOST . "/address-book/addresses/depots"; |
|
121 | - const ADDRESSES_EXPORT = self::MAIN_HOST . "/address-book/addresses/export"; |
|
122 | - const ADDRESSES_EXPORT_BY_AREAS = self::MAIN_HOST . "/address-book/addresses/export-by-areas"; |
|
123 | - const ADDRESSES_EXPORT_BY_AREA_IDS = self::MAIN_HOST . "/address-book/addresses/export-by-area-ids"; |
|
124 | - const ADDRESSES_JOB_TRACKER_STATUS = self::MAIN_HOST . "/address-book/addresses/job-tracker/status"; |
|
125 | - const ADDRESSES_JOB_TRACKER_RESULT = self::MAIN_HOST . "/address-book/addresses/job-tracker/result"; |
|
126 | - |
|
127 | - const POD_WORKFLOW = self::MAIN_HOST . "/workflows"; |
|
109 | + const ADDRESSES = self::MAIN_HOST."/address-book/addresses"; |
|
110 | + const ADDRESSES_BATCH_CREATE = self::MAIN_HOST."/address-book/addresses/batch-create"; |
|
111 | + const ADDRESSES_INDEX_ALL = self::MAIN_HOST."/address-book/addresses/index/all"; |
|
112 | + const ADDRESSES_INDEX_PAGINATION = self::MAIN_HOST."/address-book/addresses/index/pagination"; |
|
113 | + const ADDRESSES_INDEX_CLUSTERING = self::MAIN_HOST."/address-book/addresses/index/clustering"; |
|
114 | + const ADDRESSES_SHOW = self::MAIN_HOST."/address-book/addresses/show"; |
|
115 | + const ADDRESSES_BATCH_UPDATE = self::MAIN_HOST."/address-book/addresses/batch-update"; |
|
116 | + const ADDRESSES_UPDATE_BY_AREAS = self::MAIN_HOST."/address-book/addresses/update-by-areas"; |
|
117 | + const ADDRESSES_DELETE = self::MAIN_HOST."/address-book/addresses/delete"; |
|
118 | + const ADDRESSES_DELETE_BY_AREAS = self::MAIN_HOST."/address-book/addresses/delete-by-areas"; |
|
119 | + const ADDRESSES_CUSTOM_FIELDS = self::MAIN_HOST."/address-book/addresses/custom-fields"; |
|
120 | + const ADDRESSES_DEPOTS = self::MAIN_HOST."/address-book/addresses/depots"; |
|
121 | + const ADDRESSES_EXPORT = self::MAIN_HOST."/address-book/addresses/export"; |
|
122 | + const ADDRESSES_EXPORT_BY_AREAS = self::MAIN_HOST."/address-book/addresses/export-by-areas"; |
|
123 | + const ADDRESSES_EXPORT_BY_AREA_IDS = self::MAIN_HOST."/address-book/addresses/export-by-area-ids"; |
|
124 | + const ADDRESSES_JOB_TRACKER_STATUS = self::MAIN_HOST."/address-book/addresses/job-tracker/status"; |
|
125 | + const ADDRESSES_JOB_TRACKER_RESULT = self::MAIN_HOST."/address-book/addresses/job-tracker/result"; |
|
126 | + |
|
127 | + const POD_WORKFLOW = self::MAIN_HOST."/workflows"; |
|
128 | 128 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
56 | 56 | $query = isset($options['query']) |
57 | - ? array_filter($options['query'], function ($x) { |
|
57 | + ? array_filter($options['query'], function($x) { |
|
58 | 58 | return !is_null($x); |
59 | 59 | }) : []; |
60 | 60 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $ch = curl_init(); |
80 | 80 | |
81 | 81 | $url = isset($options['url']) |
82 | - ? $options['url'] . '?' . http_build_query(array_merge( |
|
82 | + ? $options['url'].'?'.http_build_query(array_merge( |
|
83 | 83 | $query, |
84 | 84 | ['api_key' => self::getApiKey()] |
85 | 85 | )) : ''; |
@@ -101,19 +101,19 @@ discard block |
||
101 | 101 | // read response headers if need |
102 | 102 | $response_headers = []; |
103 | 103 | if ($return_headers) { |
104 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$response_headers) { |
|
104 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$response_headers) { |
|
105 | 105 | $len = strlen($header); |
106 | 106 | $header = explode(':', $header, 2); |
107 | - if (count($header) >= 2) { |
|
107 | + if (count($header)>=2) { |
|
108 | 108 | $response_headers[strtolower(trim($header[0]))] = trim($header[1]); |
109 | 109 | } |
110 | 110 | return $len; |
111 | 111 | }); |
112 | 112 | } |
113 | 113 | |
114 | - if (null != $file) { |
|
114 | + if (null!=$file) { |
|
115 | 115 | $cfile = new \CURLFile($file, '', ''); |
116 | - $body['strFilename']=$cfile; |
|
116 | + $body['strFilename'] = $cfile; |
|
117 | 117 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
118 | 118 | curl_setopt($ch, CURLOPT_POST, true); |
119 | 119 | curl_setopt($ch, CURLOPT_POSTFIELDS, $body); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | case 'POST': |
133 | 133 | if (isset($body)) { |
134 | 134 | if (isset($options['HTTPHEADER']) |
135 | - && strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
135 | + && strpos($options['HTTPHEADER'], 'multipart/form-data')>0) { |
|
136 | 136 | $bodyData = $body; |
137 | 137 | } else { |
138 | 138 | $bodyData = json_encode($body); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (isset($body)) { |
150 | 150 | $bodyData = json_encode($body); |
151 | 151 | if (isset($options['HTTPHEADER'])) { |
152 | - if (strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
152 | + if (strpos($options['HTTPHEADER'], 'multipart/form-data')>0) { |
|
153 | 153 | $bodyData = $body; |
154 | 154 | } |
155 | 155 | } |
@@ -171,18 +171,18 @@ discard block |
||
171 | 171 | curl_close($ch); |
172 | 172 | |
173 | 173 | $json = null; |
174 | - if (strpos($result, '<?xml') > -1) { |
|
174 | + if (strpos($result, '<?xml')>-1) { |
|
175 | 175 | $xml = simplexml_load_string($result); |
176 | 176 | $json = self::object2array($xml); |
177 | 177 | } else { |
178 | 178 | $json = json_decode($result, true); |
179 | 179 | } |
180 | - if (200 == $code || 201 == $code || 202 == $code || 204 == $code) { |
|
180 | + if (200==$code || 201==$code || 202==$code || 204==$code) { |
|
181 | 181 | if (isset($json['errors'])) { |
182 | 182 | throw new ApiError(implode(', ', $json['errors']), $code, $result); |
183 | 183 | } else { |
184 | 184 | // return response headers if they were asked for |
185 | - if (count($response_headers) !== 0) { |
|
185 | + if (count($response_headers)!==0) { |
|
186 | 186 | $res = [ |
187 | 187 | 'code' => $code, |
188 | 188 | 'data' => $json |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | return $res; |
196 | 196 | } |
197 | - if (204 == $code) { |
|
197 | + if (204==$code) { |
|
198 | 198 | return true; |
199 | 199 | } |
200 | 200 | return $json; |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | if (isset($json['messages'])) { |
206 | 206 | $msg = ''; |
207 | 207 | foreach ($json['messages'] as $key => $value) { |
208 | - if ($msg !== '') { |
|
208 | + if ($msg!=='') { |
|
209 | 209 | $msg .= PHP_EOL; |
210 | 210 | } |
211 | - $msg .= $key . ': ' . (is_array($value) ? implode(', ', $value) : $value); |
|
211 | + $msg .= $key.': '.(is_array($value) ? implode(', ', $value) : $value); |
|
212 | 212 | } |
213 | 213 | throw new ApiError($msg, $code, $result); |
214 | 214 | } elseif (isset($json['error']) && !empty($json['error'])) { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | } elseif (isset($json['error'])) { |
217 | 217 | $msg = ''; |
218 | 218 | foreach ($json['errors'] as $key => $value) { |
219 | - if ($msg !== '') { |
|
219 | + if ($msg!=='') { |
|
220 | 220 | $msg .= PHP_EOL; |
221 | 221 | } |
222 | 222 | $msg .= $value; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | if (is_object($result1)) { |
262 | 262 | if ($deepPrinting) { |
263 | 263 | echo "<br>$key1 ------><br>"; |
264 | - $oarray = (array) $result1; |
|
264 | + $oarray = (array)$result1; |
|
265 | 265 | self::simplePrint($oarray, true); |
266 | 266 | echo '------<br>'; |
267 | 267 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | if (is_object($result)) { |
279 | 279 | if ($deepPrinting) { |
280 | 280 | echo "<br>$key ------><br>"; |
281 | - $oarray = (array) $result; |
|
281 | + $oarray = (array)$result; |
|
282 | 282 | self::simplePrint($oarray, true); |
283 | 283 | echo '------<br>'; |
284 | 284 | } else { |
@@ -44,34 +44,34 @@ |
||
44 | 44 | |
45 | 45 | if (isset($new_pod->workflow_guid)) { |
46 | 46 | $created_pod_guid = $new_pod->workflow_guid; |
47 | - echo 'Created PodWorkflow with GUID: ' . $created_pod_guid . PHP_EOL; |
|
47 | + echo 'Created PodWorkflow with GUID: '.$created_pod_guid.PHP_EOL; |
|
48 | 48 | |
49 | 49 | // read |
50 | 50 | $read_pod = $pws->getPodWorkflow($created_pod_guid); |
51 | - echo 'Read PodWorkflow with GUID: ' . $read_pod->workflow_guid . PHP_EOL; |
|
51 | + echo 'Read PodWorkflow with GUID: '.$read_pod->workflow_guid.PHP_EOL; |
|
52 | 52 | |
53 | 53 | // update |
54 | 54 | $params['title'] = 'A new Super title from 15'; |
55 | 55 | $updated_pod = $pws->updatePodWorkflow($created_pod_guid, $params); |
56 | - echo 'Updated PodWorkflow with GUID: ' . $updated_pod->workflow_guid |
|
57 | - . ', new title is "'. $updated_pod->title . '"' . PHP_EOL; |
|
56 | + echo 'Updated PodWorkflow with GUID: '.$updated_pod->workflow_guid |
|
57 | + . ', new title is "'.$updated_pod->title.'"'.PHP_EOL; |
|
58 | 58 | |
59 | 59 | //delete |
60 | 60 | $res = $pws->deletePodWorkflow($created_pod_guid); |
61 | - echo 'Deleted PodWorkflow with GUID: ' . $created_pod_guid . PHP_EOL; |
|
61 | + echo 'Deleted PodWorkflow with GUID: '.$created_pod_guid.PHP_EOL; |
|
62 | 62 | } else { |
63 | - echo 'Error creating PodWorkflow.' . PHP_EOL; |
|
63 | + echo 'Error creating PodWorkflow.'.PHP_EOL; |
|
64 | 64 | } |
65 | 65 | } catch (Exception | ApiError $e) { |
66 | - echo 'Error, Code: ' . $e->getCode() . PHP_EOL . 'Message: ' . $e->getMessage() . PHP_EOL; |
|
66 | + echo 'Error, Code: '.$e->getCode().PHP_EOL.'Message: '.$e->getMessage().PHP_EOL; |
|
67 | 67 | |
68 | 68 | if ($created_pod_guid) { |
69 | - echo 'Cleanup PodWorkflow with GUID: ' . $created_pod_guid . PHP_EOL; |
|
69 | + echo 'Cleanup PodWorkflow with GUID: '.$created_pod_guid.PHP_EOL; |
|
70 | 70 | try { |
71 | 71 | $pws->deletePodWorkflow($created_pod_guid); |
72 | 72 | } catch (Exception | ApiError $e) { |
73 | - echo 'Error: Cleanup.' . PHP_EOL; |
|
74 | - echo $e->getMessage() . PHP_EOL; |
|
73 | + echo 'Error: Cleanup.'.PHP_EOL; |
|
74 | + echo $e->getMessage().PHP_EOL; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |