This commit is contained in:
2021-08-13 14:23:18 +08:00
parent 1e8dbecbf5
commit de4e63d7f9
2 changed files with 17 additions and 5 deletions
+16 -3
View File
@@ -4,16 +4,15 @@
namespace HttpServer\Client;
use HttpServer\Client\Client;
use HttpServer\Client\Curl;
use HttpServer\Client\IClient;
use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Component;
use ReflectionException;
use Swoole\Coroutine;
/**
* Class ClientDriver
* @package HttpServer\Client
* @mixin Client
*/
class HttpClient extends Component
{
@@ -48,4 +47,18 @@ class HttpClient extends Component
}
/**
* @param string $name
* @param array $arguments
* @return void
*/
public function __call(string $name, array $arguments)
{
if (!method_exists($this, $name)) {
return static::NewRequest()->{$name}(...$arguments);
}
return $this->{$name}(...$arguments);
}
}