Skip to content

Commit

Permalink
PR review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldiron committed Nov 29, 2021
1 parent 917f82f commit 237eed7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/WebSocket/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function start(): void
$this->adapter->start();
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.start");
$errorCallback($error, "start");
}
}
}
Expand All @@ -61,7 +61,7 @@ public function shutdown(): void
$this->adapter->shutdown();
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.shutdown");
$errorCallback($error, "shutdown");
}
}
}
Expand All @@ -78,7 +78,7 @@ public function send(array $connections, string $message): void
$this->adapter->send($connections, $message);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.send");
$errorCallback($error, "send");
}
}
}
Expand All @@ -95,7 +95,7 @@ public function close(int $connection, int $code): void
$this->adapter->close($connection, $code);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.close");
$errorCallback($error, "close");
}
}
}
Expand All @@ -111,7 +111,7 @@ public function onStart(callable $callback): self
$this->adapter->onStart($callback);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.onStart");
$errorCallback($error, "onStart");
}
}
return $this;
Expand All @@ -128,7 +128,7 @@ public function onWorkerStart(callable $callback): self
$this->adapter->onWorkerStart($callback);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.onWorkerStart");
$errorCallback($error, "onWorkerStart");
}
}

Expand All @@ -146,7 +146,7 @@ public function onOpen(callable $callback): self
$this->adapter->onOpen($callback);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.onOpen");
$errorCallback($error, "onOpen");
}
}

Expand All @@ -164,7 +164,7 @@ public function onMessage(callable $callback): self
$this->adapter->onMessage($callback);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.onMessage");
$errorCallback($error, "onMessage");
}
}

Expand All @@ -182,7 +182,7 @@ public function onClose(callable $callback): self
$this->adapter->onClose($callback);
} catch(Throwable $error) {
foreach ($this->errorCallbacks as $errorCallback) {
$errorCallback($error, "utopiaWebsocket.onClose");
$errorCallback($error, "onClose");
}
}

Expand All @@ -205,7 +205,7 @@ public function getConnections(): array
* @param Throwable $error
* @return self
*/
public function onError(callable $callback): self
public function error(callable $callback): self
{
\array_push($this->errorCallbacks, $callback);
return $this;
Expand Down

0 comments on commit 237eed7

Please sign in to comment.