From c704dc05eb088f61382a345774ed2c0914620399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 24 Feb 2021 14:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Kafka/Kafka.php | 1 + System/Pool/ObjectPool.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Kafka/Kafka.php b/Kafka/Kafka.php index 8d5f004c..e70619f0 100644 --- a/Kafka/Kafka.php +++ b/Kafka/Kafka.php @@ -126,6 +126,7 @@ class Kafka extends \Snowflake\Process\Process /** * @param $kafka * @return array + * @throws ComponentException */ private function kafkaConfig($kafka): array { diff --git a/System/Pool/ObjectPool.php b/System/Pool/ObjectPool.php index 021a1db8..e77a4113 100644 --- a/System/Pool/ObjectPool.php +++ b/System/Pool/ObjectPool.php @@ -54,12 +54,13 @@ class ObjectPool extends \Snowflake\Abstracts\Pool * @param string $name * @param mixed $config * @return mixed - * @throws ReflectionException - * @throws NotFindClassException */ public function createClient(string $name, mixed $config): mixed { - return Snowflake::createObject(...$config); + if (isset($config[1])) { + return new $config[0](...$config[1]); + } + return new $config[0](); }