diff --git a/src/core/Curl/Handler.php b/src/core/Curl/Handler.php index 5f68bc9..858342a 100644 --- a/src/core/Curl/Handler.php +++ b/src/core/Curl/Handler.php @@ -176,14 +176,14 @@ public function getInfo() return $this->isAvailable() ? $this->info : false; } - public function errno() + public function errno(): int { - return $this->isAvailable() ? $this->errCode : false; + return $this->isAvailable() ? $this->errCode : 0; } - public function error() + public function error(): string { - return $this->isAvailable() ? $this->errMsg : false; + return $this->isAvailable() ? $this->errMsg : ''; } public function reset() diff --git a/src/ext/curl.php b/src/ext/curl.php index afeb990..e1f2eef 100644 --- a/src/ext/curl.php +++ b/src/ext/curl.php @@ -60,12 +60,12 @@ function swoole_curl_getinfo(Swoole\Curl\Handler $obj, int $opt = 0) return $info; } -function swoole_curl_errno(Swoole\Curl\Handler $obj) +function swoole_curl_errno(Swoole\Curl\Handler $obj): int { return $obj->errno(); } -function swoole_curl_error(Swoole\Curl\Handler $obj) +function swoole_curl_error(Swoole\Curl\Handler $obj): string { return $obj->error(); } @@ -75,9 +75,9 @@ function swoole_curl_reset(Swoole\Curl\Handler $obj) return $obj->reset(); } -function swoole_curl_close(Swoole\Curl\Handler $obj) +function swoole_curl_close(Swoole\Curl\Handler $obj): void { - return $obj->close(); + $obj->close(); } function swoole_curl_multi_getcontent(Swoole\Curl\Handler $obj)