eee
This commit is contained in:
+2
-1
@@ -5,6 +5,7 @@ namespace Kiri;
|
||||
|
||||
|
||||
use Closure;
|
||||
use CurlHandle;
|
||||
|
||||
defined('SPLIT_URL') or define('SPLIT_URL', '/(http[s]?:\/\/)?(([\w\-_]+\.)+\w+(:\d+)?)((\/[a-zA-Z0-9\-]+)+[\/]?(\?[a-zA-Z]+=.*)?)?/');
|
||||
|
||||
@@ -56,7 +57,7 @@ abstract class ClientAbstracts implements IClient
|
||||
|
||||
|
||||
/**
|
||||
* @var resource|\Swoole\Coroutine\Http\Client|\Swoole\Client|\CurlHandle
|
||||
* @var resource|\Swoole\Coroutine\Http\Client|\Swoole\Client|CurlHandle
|
||||
*/
|
||||
protected mixed $client;
|
||||
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@ class CoroutineClient extends ClientAbstracts
|
||||
* @param $path
|
||||
* @param array|string $params
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public function request(string $method, $path, array|string $params = []): void
|
||||
{
|
||||
@@ -58,7 +58,7 @@ class CoroutineClient extends ClientAbstracts
|
||||
/**
|
||||
* @param $url
|
||||
* @param array|string $data
|
||||
* @throws Exception 使用swoole协程方式请求
|
||||
* @throws
|
||||
*/
|
||||
private function coroutine($url, array|string $data = []): void
|
||||
{
|
||||
@@ -81,7 +81,7 @@ class CoroutineClient extends ClientAbstracts
|
||||
* @param $path
|
||||
* @param $data
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function execute($path, $data): void
|
||||
{
|
||||
@@ -100,7 +100,7 @@ class CoroutineClient extends ClientAbstracts
|
||||
* @param $path
|
||||
* @param $data
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function retry($path, $data): void
|
||||
{
|
||||
|
||||
+7
-7
@@ -18,7 +18,7 @@ class CurlClient extends ClientAbstracts
|
||||
* @param $method
|
||||
* @param $path
|
||||
* @param array|string $params
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public function request($method, $path, array|string $params = []): void
|
||||
{
|
||||
@@ -39,7 +39,7 @@ class CurlClient extends ClientAbstracts
|
||||
* @param $path
|
||||
* @param $method
|
||||
* @param $params
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function getCurlHandler($path, $method, $params): void
|
||||
{
|
||||
@@ -70,7 +70,7 @@ class CurlClient extends ClientAbstracts
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function curlHandlerSslSet(): void
|
||||
{
|
||||
@@ -90,7 +90,7 @@ class CurlClient extends ClientAbstracts
|
||||
* @param $resource
|
||||
* @param $path
|
||||
* @param $method
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function do($resource, $path, $method): void
|
||||
{
|
||||
@@ -143,7 +143,7 @@ class CurlClient extends ClientAbstracts
|
||||
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function execute(): void
|
||||
{
|
||||
@@ -159,7 +159,7 @@ class CurlClient extends ClientAbstracts
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function retry(): void
|
||||
{
|
||||
@@ -186,7 +186,7 @@ class CurlClient extends ClientAbstracts
|
||||
/**
|
||||
* @param $output
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private function explode($output): void
|
||||
{
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@ class HttpParse
|
||||
/**
|
||||
* @param $data
|
||||
* @return string
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public static function parse($data): string
|
||||
{
|
||||
@@ -63,7 +63,7 @@ class HttpParse
|
||||
* @param $t
|
||||
* @param $qt
|
||||
* @return string
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private static function ifElse($t, $qt): string
|
||||
{
|
||||
@@ -81,7 +81,7 @@ class HttpParse
|
||||
/**
|
||||
* @param mixed ...$object
|
||||
* @return string
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
private static function encode(...$object): string
|
||||
{
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ class TcpClient
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param int $socket
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(readonly public string $host, readonly public int $port, readonly public int $socket = SWOOLE_SOCK_TCP)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ class TcpClient
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public function reconnect(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user