Wrap Socket

This commit is contained in:
2021-01-30 20:07:28 +03:00
parent e3485416a5
commit 72dca5c73b
10 changed files with 288 additions and 214 deletions

View File

@@ -8,6 +8,9 @@ use Composer\InstalledVersions;
use InvalidArgumentException;
use JsonSerializable;
use function gethostname;
use function json_encode;
use const JSON_FORCE_OBJECT;
use const JSON_THROW_ON_ERROR;
/**
* This class is used for configuring the clients for nsq. Immutable properties must be set when creating the object and
@@ -136,4 +139,9 @@ final class ClientConfig implements JsonSerializable
'user_agent' => $this->userAgent,
];
}
public function toString(): string
{
return json_encode($this, JSON_THROW_ON_ERROR | JSON_FORCE_OBJECT);
}
}