@@ -64,9 +64,9 @@ public function __construct( $api_key, $format = 'json', $no_json_callback = 1 )
6464 private function fetch ( $ request ) {
6565
6666 if ( preg_match ( '#\?# ' , $ request ) ) {
67- $ request .= '&apiKey= ' . static ::$ api_key . " &rand= " . mt_rand (1000000 , 10000000 );
67+ $ request .= '&apiKey= ' . static ::$ api_key . ' &rand= ' . mt_rand ( 1000000 , 10000000 );
6868 } else {
69- $ request .= '?apiKey= ' .static ::$ api_key . " &rand= " . mt_rand (1000000 , 10000000 );
69+ $ request .= '?apiKey= ' .static ::$ api_key . ' &rand= ' . mt_rand ( 1000000 , 10000000 );
7070 }
7171
7272 $ request .= '&format= ' . static ::$ format ;
@@ -127,7 +127,7 @@ public function get_monitors( $search = '', $monitors = null, $custom_up_ratio =
127127 }
128128 $ result = $ this ->fetch ( $ request );
129129
130- if ( isset ( $ result ->limit ) && isset ( $ result ->offset ) && isset ( $ result ->total )) {
130+ if ( isset ( $ result ->limit ) && isset ( $ result ->offset ) && isset ( $ result ->total ) ) {
131131 $ limit = $ result ->limit ;
132132 $ offset = $ result ->offset ;
133133 $ total = $ result ->total ;
@@ -218,38 +218,38 @@ public function edit_monitor( $monitor_id, $monitor_status = null, $friendly_nam
218218
219219 $ request = $ this ->base_uri . '/editMonitor?monitorID= ' . $ monitor_id ;
220220
221- if (isset ($ monitor_status)) {
222- $ request .= '&monitorStatus= ' . $ monitor_status ;
221+ if ( isset ( $ monitor_status ) ) {
222+ $ request .= '&monitorStatus= ' . $ monitor_status ;
223223 }
224- if (isset ($ friendly_name)) {
225- $ request .= '&monitorFriendlyName= ' . urlencode ($ friendly_name );
224+ if ( isset ( $ friendly_name ) ) {
225+ $ request .= '&monitorFriendlyName= ' . urlencode ( $ friendly_name );
226226 }
227- if (isset ($ url)) {
228- $ request .= '&monitorURL= ' . $ url ;
227+ if ( isset ( $ url ) ) {
228+ $ request .= '&monitorURL= ' . $ url ;
229229 }
230- if (isset ($ type)) {
231- $ request .= '&monitorType= ' . $ type ;
230+ if ( isset ( $ type ) ) {
231+ $ request .= '&monitorType= ' . $ type ;
232232 }
233- if (isset ($ sub_type)) {
234- $ request .= '&monitorSubType= ' . $ sub_type ;
233+ if ( isset ( $ sub_type ) ) {
234+ $ request .= '&monitorSubType= ' . $ sub_type ;
235235 }
236- if (isset ($ port)) {
237- $ request .= '&monitorPort= ' . $ port ;
236+ if ( isset ( $ port ) ) {
237+ $ request .= '&monitorPort= ' . $ port ;
238238 }
239- if (isset ($ keyword_type)) {
240- $ request .= '&monitorKeywordType= ' . $ keyword_type ;
239+ if ( isset ( $ keyword_type ) ) {
240+ $ request .= '&monitorKeywordType= ' . $ keyword_type ;
241241 }
242- if (isset ($ keyword_value)) {
243- $ request .= '&monitorKeywordValue= ' . urlencode ($ keyword_value );
242+ if ( isset ( $ keyword_value ) ) {
243+ $ request .= '&monitorKeywordValue= ' . urlencode ( $ keyword_value );
244244 }
245- if (isset ($ username)) {
246- $ request .= '&monitorHTTPUsername= ' . urlencode ($ username );
245+ if ( isset ( $ username ) ) {
246+ $ request .= '&monitorHTTPUsername= ' . urlencode ( $ username );
247247 }
248- if (isset ($ password)) {
249- $ request .= '&monitorHTTPPassword= ' . urlencode ($ password );
248+ if ( isset ( $ password ) ) {
249+ $ request .= '&monitorHTTPPassword= ' . urlencode ( $ password );
250250 }
251- if (! empty ($ alert_contacts)) {
252- $ request .= '&monitorAlertContacts= ' . $ this ->get_implode ($ alert_contacts );
251+ if ( ! empty ( $ alert_contacts ) ) {
252+ $ request .= '&monitorAlertContacts= ' . $ this ->get_implode ( $ alert_contacts );
253253 }
254254
255255 return $ this ->fetch ( $ request );
0 commit comments