From 8046eae8464106473eb63f7d15d13fda5889bc2e Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Sat, 23 Jan 2021 00:37:48 +0300 Subject: [PATCH] Remove Config class --- src/Config.php | 19 ------------------- src/Connection.php | 6 +++--- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 src/Config.php diff --git a/src/Config.php b/src/Config.php deleted file mode 100644 index d15130c..0000000 --- a/src/Config.php +++ /dev/null @@ -1,19 +0,0 @@ -address = $address; - } -} diff --git a/src/Connection.php b/src/Connection.php index 59f5f67..808001f 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -41,7 +41,7 @@ abstract class Connection private bool $closed = false; - private Config $config; + private string $address; /** * @var array{client_id: string, hostname: string, user_agent: string} @@ -55,7 +55,7 @@ abstract class Connection string $hostname = null, string $userAgent = null ) { - $this->config = new Config($address); + $this->address = $address; $this->features = [ 'client_id' => $clientId ?? '', @@ -68,7 +68,7 @@ abstract class Connection public function connect(): void { - $this->socket = (new Factory())->createClient($this->config->address); + $this->socket = (new Factory())->createClient($this->address); $this->send(' V2'); $body = json_encode($this->features, JSON_THROW_ON_ERROR | JSON_FORCE_OBJECT);