@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @see fsockopen_header |
83 | 83 | * @param Requests_Hooks $hooks Hook system |
84 | 84 | */ |
85 | - public function register(Requests_Hooks &$hooks) { |
|
85 | + public function register(Requests_Hooks & $hooks) { |
|
86 | 86 | $hooks->register('curl.before_send', array(&$this, 'curl_before_send')); |
87 | 87 | |
88 | 88 | $hooks->register('fsockopen.remote_socket', array(&$this, 'fsockopen_remote_socket')); |
@@ -146,6 +146,6 @@ discard block |
||
146 | 146 | * @return string |
147 | 147 | */ |
148 | 148 | public function get_auth_string() { |
149 | - return $this->user . ':' . $this->pass; |
|
149 | + return $this->user.':'.$this->pass; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | \ No newline at end of file |
@@ -93,7 +93,7 @@ |
||
93 | 93 | $string = self::punycode_encode($string); |
94 | 94 | |
95 | 95 | // Step 7: Prepend ACE prefix |
96 | - $string = self::ACE_PREFIX . $string; |
|
96 | + $string = self::ACE_PREFIX.$string; |
|
97 | 97 | |
98 | 98 | // Step 8: Check size |
99 | 99 | if (strlen($string) < 64) { |
@@ -29,5 +29,5 @@ |
||
29 | 29 | * @see Requests_Hooks::register |
30 | 30 | * @param Requests_Hooks $hooks Hook system |
31 | 31 | */ |
32 | - public function register(Requests_Hooks &$hooks); |
|
32 | + public function register(Requests_Hooks & $hooks); |
|
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @see fsockopen_header |
54 | 54 | * @param Requests_Hooks $hooks Hook system |
55 | 55 | */ |
56 | - public function register(Requests_Hooks &$hooks) { |
|
56 | + public function register(Requests_Hooks & $hooks) { |
|
57 | 57 | $hooks->register('curl.before_send', array(&$this, 'curl_before_send')); |
58 | 58 | $hooks->register('fsockopen.after_headers', array(&$this, 'fsockopen_header')); |
59 | 59 | } |
@@ -83,6 +83,6 @@ discard block |
||
83 | 83 | * @return string |
84 | 84 | */ |
85 | 85 | public function getAuthString() { |
86 | - return $this->user . ':' . $this->pass; |
|
86 | + return $this->user.':'.$this->pass; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | \ No newline at end of file |
@@ -162,7 +162,7 @@ |
||
162 | 162 | * |
163 | 163 | * @var Requests_Response $response |
164 | 164 | */ |
165 | - public function before_redirect_check(Requests_Response &$return) { |
|
165 | + public function before_redirect_check(Requests_Response & $return) { |
|
166 | 166 | $url = $return->url; |
167 | 167 | if (!$url instanceof Requests_IRI) { |
168 | 168 | $url = new Requests_IRI($url); |
@@ -344,7 +344,7 @@ |
||
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | - $header_value .= '; ' . implode('; ', $parts); |
|
347 | + $header_value .= '; '.implode('; ', $parts); |
|
348 | 348 | } |
349 | 349 | return $header_value; |
350 | 350 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $options['hooks']->dispatch('curl.before_request', array(&$this->handle)); |
311 | 311 | |
312 | 312 | // Force closing the connection for old versions of cURL (<7.22). |
313 | - if ( ! isset( $headers['Connection'] ) ) { |
|
313 | + if (!isset($headers['Connection'])) { |
|
314 | 314 | $headers['Connection'] = 'close'; |
315 | 315 | } |
316 | 316 | |
@@ -505,11 +505,11 @@ discard block |
||
505 | 505 | $query = $url_parts['query']; |
506 | 506 | } |
507 | 507 | |
508 | - $query .= '&' . http_build_query($data, null, '&'); |
|
508 | + $query .= '&'.http_build_query($data, null, '&'); |
|
509 | 509 | $query = trim($query, '&'); |
510 | 510 | |
511 | 511 | if (empty($url_parts['query'])) { |
512 | - $url .= '?' . $query; |
|
512 | + $url .= '?'.$query; |
|
513 | 513 | } |
514 | 514 | else { |
515 | 515 | $url = str_replace($url_parts['query'], $query, $url); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | // HTTPS support |
71 | 71 | if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { |
72 | - $remote_socket = 'ssl://' . $host; |
|
72 | + $remote_socket = 'ssl://'.$host; |
|
73 | 73 | if (!isset($url_parts['port'])) { |
74 | 74 | $url_parts['port'] = 443; |
75 | 75 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | stream_context_set_option($context, array('ssl' => $context_options)); |
107 | 107 | } |
108 | 108 | else { |
109 | - $remote_socket = 'tcp://' . $host; |
|
109 | + $remote_socket = 'tcp://'.$host; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $this->max_bytes = $options['max_bytes']; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if (!isset($url_parts['port'])) { |
115 | 115 | $url_parts['port'] = 80; |
116 | 116 | } |
117 | - $remote_socket .= ':' . $url_parts['port']; |
|
117 | + $remote_socket .= ':'.$url_parts['port']; |
|
118 | 118 | |
119 | 119 | set_error_handler(array($this, 'connect_error_handler'), E_WARNING | E_NOTICE); |
120 | 120 | |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | if (!isset($case_insensitive_headers['Host'])) { |
175 | 175 | $out .= sprintf('Host: %s', $url_parts['host']); |
176 | 176 | |
177 | - if (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) { |
|
178 | - $out .= ':' . $url_parts['port']; |
|
177 | + if (('http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80) || ('https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443)) { |
|
178 | + $out .= ':'.$url_parts['port']; |
|
179 | 179 | } |
180 | 180 | $out .= "\r\n"; |
181 | 181 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $headers = Requests::flatten($headers); |
193 | 193 | |
194 | 194 | if (!empty($headers)) { |
195 | - $out .= implode($headers, "\r\n") . "\r\n"; |
|
195 | + $out .= implode($headers, "\r\n")."\r\n"; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $options['hooks']->dispatch('fsockopen.after_headers', array(&$out)); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $out .= "Connection: Close\r\n"; |
206 | 206 | } |
207 | 207 | |
208 | - $out .= "\r\n" . $request_body; |
|
208 | + $out .= "\r\n".$request_body; |
|
209 | 209 | |
210 | 210 | $options['hooks']->dispatch('fsockopen.before_send', array(&$out)); |
211 | 211 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | fclose($download); |
284 | 284 | } |
285 | 285 | else { |
286 | - $this->headers .= "\r\n\r\n" . $body; |
|
286 | + $this->headers .= "\r\n\r\n".$body; |
|
287 | 287 | } |
288 | 288 | fclose($socket); |
289 | 289 | |
@@ -353,12 +353,12 @@ discard block |
||
353 | 353 | $url_parts['query'] = ''; |
354 | 354 | } |
355 | 355 | |
356 | - $url_parts['query'] .= '&' . http_build_query($data, null, '&'); |
|
356 | + $url_parts['query'] .= '&'.http_build_query($data, null, '&'); |
|
357 | 357 | $url_parts['query'] = trim($url_parts['query'], '&'); |
358 | 358 | } |
359 | 359 | if (isset($url_parts['path'])) { |
360 | 360 | if (isset($url_parts['query'])) { |
361 | - $get = $url_parts['path'] . '?' . $url_parts['query']; |
|
361 | + $get = $url_parts['path'].'?'.$url_parts['query']; |
|
362 | 362 | } |
363 | 363 | else { |
364 | 364 | $get = $url_parts['path']; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | return false; |
384 | 384 | } |
385 | 385 | |
386 | - $this->connect_error .= $errstr . "\n"; |
|
386 | + $this->connect_error .= $errstr."\n"; |
|
387 | 387 | return true; |
388 | 388 | } |
389 | 389 |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | * @param mixed $value Property value |
154 | 154 | */ |
155 | 155 | public function __set($name, $value) { |
156 | - if (method_exists($this, 'set_' . $name)) { |
|
157 | - call_user_func(array($this, 'set_' . $name), $value); |
|
156 | + if (method_exists($this, 'set_'.$name)) { |
|
157 | + call_user_func(array($this, 'set_'.$name), $value); |
|
158 | 158 | } |
159 | 159 | elseif ( |
160 | 160 | $name === 'iauthority' |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | || $name === 'iquery' |
165 | 165 | || $name === 'ifragment' |
166 | 166 | ) { |
167 | - call_user_func(array($this, 'set_' . substr($name, 1)), $value); |
|
167 | + call_user_func(array($this, 'set_'.substr($name, 1)), $value); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -185,14 +185,14 @@ discard block |
||
185 | 185 | $name === 'iauthority' || |
186 | 186 | $name === 'authority' |
187 | 187 | ) { |
188 | - $method = 'get_' . $name; |
|
188 | + $method = 'get_'.$name; |
|
189 | 189 | $return = $this->$method(); |
190 | 190 | } |
191 | 191 | elseif (array_key_exists($name, $props)) { |
192 | 192 | $return = $this->$name; |
193 | 193 | } |
194 | 194 | // host -> ihost |
195 | - elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) { |
|
195 | + elseif (($prop = 'i'.$name) && array_key_exists($prop, $props)) { |
|
196 | 196 | $name = $prop; |
197 | 197 | $return = $this->$prop; |
198 | 198 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $return = $this->$prop; |
203 | 203 | } |
204 | 204 | else { |
205 | - trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); |
|
205 | + trigger_error('Undefined property: '.get_class($this).'::'.$name, E_USER_NOTICE); |
|
206 | 206 | $return = null; |
207 | 207 | } |
208 | 208 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @return bool |
222 | 222 | */ |
223 | 223 | public function __isset($name) { |
224 | - return (method_exists($this, 'get_' . $name) || isset($this->$name)); |
|
224 | + return (method_exists($this, 'get_'.$name) || isset($this->$name)); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | * @param string $name Property name |
231 | 231 | */ |
232 | 232 | public function __unset($name) { |
233 | - if (method_exists($this, 'set_' . $name)) { |
|
234 | - call_user_func(array($this, 'set_' . $name), ''); |
|
233 | + if (method_exists($this, 'set_'.$name)) { |
|
234 | + call_user_func(array($this, 'set_'.$name), ''); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -287,10 +287,10 @@ discard block |
||
287 | 287 | $target->ipath = $relative->ipath; |
288 | 288 | } |
289 | 289 | elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { |
290 | - $target->ipath = '/' . $relative->ipath; |
|
290 | + $target->ipath = '/'.$relative->ipath; |
|
291 | 291 | } |
292 | 292 | elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { |
293 | - $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; |
|
293 | + $target->ipath = substr($base->ipath, 0, $last_segment + 1).$relative->ipath; |
|
294 | 294 | } |
295 | 295 | else { |
296 | 296 | $target->ipath = $relative->ipath; |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $input = ''; |
406 | 406 | } |
407 | 407 | } |
408 | - return $output . $input; |
|
408 | + return $output.$input; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | || $character > 0xD7FF && $character < 0xF900 |
633 | 633 | ) { |
634 | 634 | for ($j = $start; $j <= $i; $j++) { |
635 | - $string .= '%' . strtoupper($bytes[$j]); |
|
635 | + $string .= '%'.strtoupper($bytes[$j]); |
|
636 | 636 | } |
637 | 637 | } |
638 | 638 | else { |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | // mid-way through a multi-byte sequence) |
648 | 648 | if ($remaining) { |
649 | 649 | for ($j = $start; $j < $len; $j++) { |
650 | - $string .= '%' . strtoupper($bytes[$j]); |
|
650 | + $string .= '%'.strtoupper($bytes[$j]); |
|
651 | 651 | } |
652 | 652 | } |
653 | 653 | |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | } |
863 | 863 | if (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { |
864 | 864 | if (Requests_IPv6::check_ipv6(substr($ihost, 1, -1))) { |
865 | - $this->ihost = '[' . Requests_IPv6::compress(substr($ihost, 1, -1)) . ']'; |
|
865 | + $this->ihost = '['.Requests_IPv6::compress(substr($ihost, 1, -1)).']'; |
|
866 | 866 | } |
867 | 867 | else { |
868 | 868 | $this->ihost = null; |
@@ -1019,17 +1019,17 @@ discard block |
||
1019 | 1019 | |
1020 | 1020 | $iri = ''; |
1021 | 1021 | if ($this->scheme !== null) { |
1022 | - $iri .= $this->scheme . ':'; |
|
1022 | + $iri .= $this->scheme.':'; |
|
1023 | 1023 | } |
1024 | 1024 | if (($iauthority = $this->get_iauthority()) !== null) { |
1025 | - $iri .= '//' . $iauthority; |
|
1025 | + $iri .= '//'.$iauthority; |
|
1026 | 1026 | } |
1027 | 1027 | $iri .= $this->ipath; |
1028 | 1028 | if ($this->iquery !== null) { |
1029 | - $iri .= '?' . $this->iquery; |
|
1029 | + $iri .= '?'.$this->iquery; |
|
1030 | 1030 | } |
1031 | 1031 | if ($this->ifragment !== null) { |
1032 | - $iri .= '#' . $this->ifragment; |
|
1032 | + $iri .= '#'.$this->ifragment; |
|
1033 | 1033 | } |
1034 | 1034 | |
1035 | 1035 | return $iri; |
@@ -1056,13 +1056,13 @@ discard block |
||
1056 | 1056 | |
1057 | 1057 | $iauthority = ''; |
1058 | 1058 | if ($this->iuserinfo !== null) { |
1059 | - $iauthority .= $this->iuserinfo . '@'; |
|
1059 | + $iauthority .= $this->iuserinfo.'@'; |
|
1060 | 1060 | } |
1061 | 1061 | if ($this->ihost !== null) { |
1062 | 1062 | $iauthority .= $this->ihost; |
1063 | 1063 | } |
1064 | 1064 | if ($this->port !== null) { |
1065 | - $iauthority .= ':' . $this->port; |
|
1065 | + $iauthority .= ':'.$this->port; |
|
1066 | 1066 | } |
1067 | 1067 | return $iauthority; |
1068 | 1068 | } |