@@ -155,6 +155,7 @@ discard block |
||
155 | 155 | * Find element in HTML Dom |
156 | 156 | * |
157 | 157 | * @param string $content - content to be searched through |
158 | + * @param integer $nth |
|
158 | 159 | * @return object |
159 | 160 | */ |
160 | 161 | private function find($content, $selector, $nth = null) |
@@ -204,6 +205,7 @@ discard block |
||
204 | 205 | * Check whether errors have been returned |
205 | 206 | * |
206 | 207 | * @param string $content - response body of a request |
208 | + * @param string $selector |
|
207 | 209 | * @return boolean - false if an element described by the selector exists |
208 | 210 | */ |
209 | 211 | private function check($content, $selector) |
@@ -107,7 +107,7 @@ |
||
107 | 107 | * @param string $recipient - number of the recipient (9 digits without leading zero for national numbers e.g. 501234567; two leading zeros followed by prefix for international numbers e.g. 004912345678901; no spaces or special chars) |
108 | 108 | * @param string $text - content of the SMS |
109 | 109 | */ |
110 | - // TODO: check number of recipient for validaty |
|
110 | + // TODO: check number of recipient for validaty |
|
111 | 111 | public function send($recipient, $text) |
112 | 112 | { |
113 | 113 | if (strlen($text) <= 0 || strlen($text) > $this->max_length) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->html = $html; |
43 | 43 | |
44 | 44 | $random = rand(1000000000, 2147483647); |
45 | - $this->dynSess = $random . $random; |
|
45 | + $this->dynSess = $random.$random; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function login($login, $password) |
58 | 58 | { |
59 | 59 | // Referer header set only to act more like a browser |
60 | - $this->session->headers['Referer'] = $this->url . $this->login_request_uri; |
|
60 | + $this->session->headers['Referer'] = $this->url.$this->login_request_uri; |
|
61 | 61 | |
62 | 62 | $this->session->data = array( |
63 | 63 | '_dyncharset' => 'UTF-8', |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | '_DARGS' => '/ocp/gear/infoportal/portlets/login/login-box.jsp' |
80 | 80 | ); |
81 | 81 | |
82 | - $response = $this->session->post($this->login_request_uri . $this->login_post_query_string); |
|
82 | + $response = $this->session->post($this->login_request_uri.$this->login_post_query_string); |
|
83 | 83 | |
84 | 84 | $this->token = $this->token($response->body); |
85 | 85 | |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | public function send($recipient, $text) |
112 | 112 | { |
113 | 113 | if (strlen($text) <= 0 || strlen($text) > $this->max_length) { |
114 | - throw new Exception('The message must be longer than 0 characters, but shorter than ' . $this->max_length . ' characters'); |
|
114 | + throw new Exception('The message must be longer than 0 characters, but shorter than '.$this->max_length.' characters'); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | $this->session->options['timeout'] = 30; |
118 | 118 | |
119 | 119 | // Referer header set only to act more like a browser |
120 | - $this->session->headers['Referer'] = $this->url . $this->send_request_uri; |
|
120 | + $this->session->headers['Referer'] = $this->url.$this->send_request_uri; |
|
121 | 121 | |
122 | 122 | $this->session->data = array( |
123 | 123 | '_dyncharset' => 'UTF-8', |
@@ -181,8 +181,11 @@ |
||
181 | 181 | if (!empty($element->plaintext)) { |
182 | 182 | $value = trim($value); |
183 | 183 | $value_int = intval($value); |
184 | - if (is_int($value_int)) $result = $value_int; |
|
185 | - else $result = $value; |
|
184 | + if (is_int($value_int)) { |
|
185 | + $result = $value_int; |
|
186 | + } else { |
|
187 | + $result = $value; |
|
188 | + } |
|
186 | 189 | } else { |
187 | 190 | $result = false; |
188 | 191 | } |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | |
40 | 40 | if ($send['check'] && $login['free'] > $send['free'] && is_int($send['free'])) { |
41 | 41 | |
42 | - echo 'SMS was successfully sent. This month ' . $send['free'] . ' free SMS left.'; |
|
42 | + echo 'SMS was successfully sent. This month '.$send['free'].' free SMS left.'; |
|
43 | 43 | |
44 | 44 | } elseif ($login['free'] == $send['free']) { |
45 | 45 | |
46 | - echo 'Count of free SMS has not changed. Was ' . $login['free'] . ' and is ' . $send['free'] . ' . SMS was most probably not sent.'; |
|
46 | + echo 'Count of free SMS has not changed. Was '.$login['free'].' and is '.$send['free'].' . SMS was most probably not sent.'; |
|
47 | 47 | |
48 | 48 | } else { |
49 | 49 | |
@@ -63,6 +63,6 @@ discard block |
||
63 | 63 | |
64 | 64 | } catch (Exception $e) { |
65 | 65 | |
66 | - echo '[ERROR] ' . $e->getMessage(); |
|
66 | + echo '[ERROR] '.$e->getMessage(); |
|
67 | 67 | |
68 | 68 | } |