Remove Config class

This commit is contained in:
2021-01-23 00:37:48 +03:00
parent c7617cbf6e
commit 8046eae846
2 changed files with 3 additions and 22 deletions

View File

@ -1,19 +0,0 @@
<?php
declare(strict_types=1);
namespace Nsq;
/**
* @psalm-immutable
*/
final class Config
{
public string $address;
public function __construct(
string $address
) {
$this->address = $address;
}
}

View File

@ -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);