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](); }