diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-03-02 23:57:41 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-03-02 23:57:41 +0300 |
commit | 214620454419e19e007fc62b05961bf81060947a (patch) | |
tree | f92e0502dddf598480ef97b16e6b865c17745dab | |
parent | 5a652b552feea9fe8e587492d01047457324274d (diff) |
code fixes here and there
-rw-r--r-- | src/Client.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Client.php b/src/Client.php index 1756c6c..d1f8b7b 100644 --- a/src/Client.php +++ b/src/Client.php @@ -176,7 +176,7 @@ class Client { /** * @param string $raw_string - * @return RequestMessage|ResponseMessage + * @return RequestMessage|ResponseMessage|PingMessage|PongMessage * @throws \Exception */ protected static function parseMessage(string $raw_string) { @@ -225,11 +225,9 @@ class Client { case Message::PING: return new PingMessage(); - break; case Message::PONG: return new PongMessage(); - break; default: throw new \Exception("Malformed message: unexpected type {$type}"); @@ -239,7 +237,7 @@ class Client { /** * @param mixed $data * @param array $schema - * @return bool + * @throws \Exception */ protected static function validateData($data, array $schema) { if (!$data || !is_array($data)) @@ -294,7 +292,7 @@ class Client { } /** - * @return bool + * Close connection. */ public function close() { if (!$this->sock) |