@@ -3,7 +3,6 @@ |
||
| 3 | 3 | require __DIR__ . '/../vendor/autoload.php'; |
| 4 | 4 | |
| 5 | 5 | use mpyw\Co\Co; |
| 6 | -use mpyw\Co\CURLException; |
|
| 7 | 6 | |
| 8 | 7 | function curl_init_with($url, array $options = [CURLOPT_RETURNTRANSFER => true]) { |
| 9 | 8 | $ch = curl_init($url); |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | require __DIR__ . '/../vendor/autoload.php'; |
| 4 | 4 | |
| 5 | 5 | use mpyw\Co\Co; |
| 6 | -use mpyw\Co\CURLException; |
|
| 7 | 6 | |
| 8 | 7 | function curl_init_with($url, array $options = [CURLOPT_RETURNTRANSFER => true]) { |
| 9 | 8 | $ch = curl_init($url); |
@@ -12,6 +12,10 @@ discard block |
||
| 12 | 12 | throw new \RuntimeException($error['message']); |
| 13 | 13 | } |
| 14 | 14 | } |
| 15 | +/** |
|
| 16 | + * @param integer $status |
|
| 17 | + * @param string $message |
|
| 18 | + */ |
|
| 15 | 19 | function respond_rest($con, $status, $message, $content) { |
| 16 | 20 | try { |
| 17 | 21 | $length = strlen($content); |
@@ -24,6 +28,11 @@ discard block |
||
| 24 | 28 | } |
| 25 | 29 | fclose($con); |
| 26 | 30 | } |
| 31 | +/** |
|
| 32 | + * @param Closure $tick_function |
|
| 33 | + * @param integer $tick |
|
| 34 | + * @param integer $times |
|
| 35 | + */ |
|
| 27 | 36 | function respond_streaming($con, $tick_function, $tick, $times) { |
| 28 | 37 | try { |
| 29 | 38 | fsend($con, "HTTP/1.1 200 OK\r\n"); |
@@ -62,7 +62,6 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @access public |
| 64 | 64 | * @static |
| 65 | - * @param int $concurrency |
|
| 66 | 65 | * @param bool $throw |
| 67 | 66 | */ |
| 68 | 67 | public static function setDefaultThrow($throw) |
@@ -451,7 +450,7 @@ discard block |
||
| 451 | 450 | * |
| 452 | 451 | * @access private |
| 453 | 452 | * @param Generator $value |
| 454 | - * @return bool |
|
| 453 | + * @return boolean|null |
|
| 455 | 454 | */ |
| 456 | 455 | private function canThrow(\Generator $value) |
| 457 | 456 | { |
@@ -514,7 +513,7 @@ discard block |
||
| 514 | 513 | * @access private |
| 515 | 514 | * @static |
| 516 | 515 | * @param int|float|string $interval |
| 517 | - * @return int |
|
| 516 | + * @return double |
|
| 518 | 517 | */ |
| 519 | 518 | private static function validateInterval($interval) |
| 520 | 519 | { |