@@ -232,7 +232,7 @@ |
||
| 232 | 232 | * |
| 233 | 233 | * @param array $request Request data (same form as {@see request_multiple}) |
| 234 | 234 | * @param boolean $merge_options Should we merge options as well? |
| 235 | - * @return array Request data |
|
| 235 | + * @return string Request data |
|
| 236 | 236 | */ |
| 237 | 237 | protected function merge_request($request, $merge_options = true) { |
| 238 | 238 | if ($this->url !== null) { |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | $context['files'] = ''; |
| 36 | -$path = realpath(dirname(__FILE__).'/../library/Requests'); |
|
| 36 | +$path = realpath(dirname(__FILE__) . '/../library/Requests'); |
|
| 37 | 37 | foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { |
| 38 | - if (preg_match('/\.php$/', $file)) { |
|
| 38 | + if (preg_match('/\.php$/', $file)) { |
|
| 39 | 39 | $name = str_replace($path . DIRECTORY_SEPARATOR, '', $file); |
| 40 | 40 | $name = str_replace(DIRECTORY_SEPARATOR, '/', $name); |
| 41 | 41 | $context['files'][] = "\t\t\t\t\t" . '<file install-as="Requests/' . $name . '" name="' . $name . '" role="php" />'; |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $context['files'] = implode("\n", $context['files']); |
| 46 | 46 | |
| 47 | -$template = file_get_contents(dirname(__FILE__).'/../package.xml.tpl'); |
|
| 47 | +$template = file_get_contents(dirname(__FILE__) . '/../package.xml.tpl'); |
|
| 48 | 48 | $content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template); |
| 49 | -file_put_contents(dirname(__FILE__).'/../package.xml', $content); |
|
| 49 | +file_put_contents(dirname(__FILE__) . '/../package.xml', $content); |
|
| 50 | 50 | |
| 51 | 51 | function replace_parameters($matches) { |
| 52 | 52 | global $context; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $context['files'] = ''; |
| 36 | 36 | $path = realpath(dirname(__FILE__).'/../library/Requests'); |
| 37 | 37 | foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { |
| 38 | - if (preg_match('/\.php$/', $file)) { |
|
| 38 | + if (preg_match('/\.php$/', $file)) { |
|
| 39 | 39 | $name = str_replace($path . DIRECTORY_SEPARATOR, '', $file); |
| 40 | 40 | $name = str_replace(DIRECTORY_SEPARATOR, '/', $name); |
| 41 | 41 | $context['files'][] = "\t\t\t\t\t" . '<file install-as="Requests/' . $name . '" name="' . $name . '" role="php" />'; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | * @return string Default certificate path. |
| 532 | 532 | */ |
| 533 | 533 | public static function get_certificate_path() { |
| 534 | - if ( ! empty( Requests::$certificate_path ) ) { |
|
| 534 | + if (!empty(Requests::$certificate_path)) { |
|
| 535 | 535 | return Requests::$certificate_path; |
| 536 | 536 | } |
| 537 | 537 | |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * |
| 544 | 544 | * @param string $path Certificate path, pointing to a PEM file. |
| 545 | 545 | */ |
| 546 | - public static function set_certificate_path( $path ) { |
|
| 546 | + public static function set_certificate_path($path) { |
|
| 547 | 547 | Requests::$certificate_path = $path; |
| 548 | 548 | } |
| 549 | 549 | |
@@ -310,7 +310,7 @@ |
||
| 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 | |
@@ -171,7 +171,7 @@ |
||
| 171 | 171 | if (!isset($case_insensitive_headers['Host'])) { |
| 172 | 172 | $out .= sprintf('Host: %s', $url_parts['host']); |
| 173 | 173 | |
| 174 | - if (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) { |
|
| 174 | + if (('http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80) || ('https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443)) { |
|
| 175 | 175 | $out .= ':' . $url_parts['port']; |
| 176 | 176 | } |
| 177 | 177 | $out .= "\r\n"; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | * |
| 251 | 251 | * Returns false if $base is not absolute, otherwise an IRI. |
| 252 | 252 | * |
| 253 | - * @param Requests_IRI|string $base (Absolute) Base IRI |
|
| 253 | + * @param string $base (Absolute) Base IRI |
|
| 254 | 254 | * @param Requests_IRI|string $relative Relative IRI |
| 255 | 255 | * @return Requests_IRI|false |
| 256 | 256 | */ |
@@ -985,6 +985,7 @@ discard block |
||
| 985 | 985 | * Convert an IRI to a URI (or parts thereof) |
| 986 | 986 | * |
| 987 | 987 | * @param string|bool IRI to convert (or false from {@see get_iri}) |
| 988 | + * @param false|string $string |
|
| 988 | 989 | * @return string|false URI if IRI is valid, false otherwise. |
| 989 | 990 | */ |
| 990 | 991 | protected function to_uri($string) { |
@@ -353,7 +353,7 @@ |
||
| 353 | 353 | * @param int $delta |
| 354 | 354 | * @param int $numpoints |
| 355 | 355 | * @param bool $firsttime |
| 356 | - * @return int New bias |
|
| 356 | + * @return double New bias |
|
| 357 | 357 | * |
| 358 | 358 | * function adapt(delta,numpoints,firsttime): |
| 359 | 359 | */ |