From 99782ed5acb0c57a182c194ef3528d89fd02a37f Mon Sep 17 00:00:00 2001 From: Pieter Oliver Date: Mon, 22 Jul 2024 17:52:10 +0100 Subject: [PATCH 1/2] Change path of license file to be the actual path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d03c8e..3ea9cdd 100644 --- a/README.md +++ b/README.md @@ -95,5 +95,5 @@ $server ### License -[ISC License](COPYING.md) +[ISC License](LICENSE.md) From e5696b3cd90ea31882100e41c8ef77349bd6b71a Mon Sep 17 00:00:00 2001 From: Pieter Oliver Date: Mon, 22 Jul 2024 17:52:27 +0100 Subject: [PATCH 2/2] Amend several typoes --- docs/Client.md | 4 ++-- docs/Examples.md | 4 ++-- docs/Listener.md | 6 +++--- docs/Middleware/CloseHandler.md | 2 +- docs/Middleware/FollowRedirect.md | 2 +- docs/Middleware/PingResponder.md | 2 +- docs/Middleware/SubprotocolNegotiation.md | 2 +- docs/Migrate_2_3.md | 2 +- docs/Server.md | 6 +++--- src/Middleware/ProcessHttpStack.php | 4 ++-- src/Server.php | 2 +- src/Trait/SendMethodsTrait.php | 2 +- tests/suites/client/ClientErrorTest.php | 2 +- tests/suites/client/ClientTest.php | 2 +- tests/suites/http/RequestTest.php | 2 +- tests/suites/http/ResponseTest.php | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/Client.md b/docs/Client.md index 00832c0..c4459e8 100644 --- a/docs/Client.md +++ b/docs/Client.md @@ -157,7 +157,7 @@ $client->send(new WebSocket\Message\Ping("My ping")); $client->send(new WebSocket\Message\Text("My pong")); $client->send(new WebSocket\Message\Close(1000, "Closing now")); ``` -The are also convenience methods available for all types. +There are also convenience methods available for all types. ```php $client->text("Server sends a message"); $client->binary($binary); @@ -178,7 +178,7 @@ if (!$client->isConnected()) { $client->disconnect(); ``` -When connected, there are addintional info to retrieve. +When connected, there are additional info to retrieve. ```php // View client name diff --git a/docs/Examples.md b/docs/Examples.md index e6faa59..37a60e1 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -39,7 +39,7 @@ info | Received 'close' message [] This setup will create Client that sends initial message to Server, and then subscribes to messages sent by Server. -The `PingInterval` (possibly change interval) will keep conneciton open. +The `PingInterval` (possibly change interval) will keep connection open. If something goes wrong, it will in most cases be able to re-connect and resume subscription. ```php @@ -102,7 +102,7 @@ php examples/send.php --opcode text --debug "A text message" // Use runtime debu Source: [examples/echoserver.php](../examples/echoserver.php) -A simple server that responds to recevied commands. +A simple server that responds to received commands. Example use: ``` diff --git a/docs/Listener.md b/docs/Listener.md index 6939ad9..2ccba87 100644 --- a/docs/Listener.md +++ b/docs/Listener.md @@ -3,7 +3,7 @@ # Websocket: Listener Both [Client](Client.md) and [Server](Server.md) support registering listeners as callback functions. -Listeners will be called when a message is received, a conneciton is opened and closed, and when an error occurs. +Listeners will be called when a message is received, a connection is opened and closed, and when an error occurs. If you use the listener method `->start()` this will be the only way to act on incoming messages. ## Message listeners @@ -75,11 +75,11 @@ $client_or_server Using above functions, your Client and Server will be able to receive incoming messages and take action accordingly. But what if your implementation need to process other data, and send unsolicited messages? -The coroutine implementation will regulary call the `onTick()` method, depending on workload and configuration. +The coroutine implementation will regularly call the `onTick()` method, depending on workload and configuration. ```php $client_or_server - // Regulary called, regardless of connections + // Regularly called, regardless of connections ->onTick(function (WebSocket\Client|WebSocket\Server $client_or_server) { // Do anything }) diff --git a/docs/Middleware/CloseHandler.md b/docs/Middleware/CloseHandler.md index eace0ef..23511a6 100644 --- a/docs/Middleware/CloseHandler.md +++ b/docs/Middleware/CloseHandler.md @@ -2,7 +2,7 @@ # Websocket: CloseHandler middleware -Thid middleware provide standard operability according to WebSocket protocol, +This middleware provide standard operability according to WebSocket protocol, and should be added unless you write your own implementation of close handling. * When a Close message is received, CloseHandler will respond with a Close confirmation message diff --git a/docs/Middleware/FollowRedirect.md b/docs/Middleware/FollowRedirect.md index adfc738..c9423ea 100644 --- a/docs/Middleware/FollowRedirect.md +++ b/docs/Middleware/FollowRedirect.md @@ -9,7 +9,7 @@ During handshake, it reacts to `3xx` HTTP status and reconnect the Client to pro ## Client -Will follow redirect by setting new URI and reconnecy the Client if; +Will follow redirect by setting new URI and reconnect the Client if; * Server response during handshake has a `3xx` status * Server response also includes a `Location` header * Maximum number of redirects has not been exceeded diff --git a/docs/Middleware/PingResponder.md b/docs/Middleware/PingResponder.md index 266f539..5f817b5 100644 --- a/docs/Middleware/PingResponder.md +++ b/docs/Middleware/PingResponder.md @@ -2,7 +2,7 @@ # Websocket: PingResponder middleware -Thid middleware provide standard operability according to WebSocket protocol, +This middleware provide standard operability according to WebSocket protocol, and should be added unless you write your own implementation of ping/pong handling. * When a Ping message is received, PingResponder will respond with a Pong message diff --git a/docs/Middleware/SubprotocolNegotiation.md b/docs/Middleware/SubprotocolNegotiation.md index 8eb2ec9..3d69a37 100644 --- a/docs/Middleware/SubprotocolNegotiation.md +++ b/docs/Middleware/SubprotocolNegotiation.md @@ -27,7 +27,7 @@ $selected_subprotocol = $this->client->getMeta('subprotocolNegotiation.selected' When added on Server, it should be defined with a list of subprotocols that Server support. When Client request subprotocols, it will select the first requested protocol available in the list. -The ClienServert MUST expect Client to send messages according to selected subprotocol. +The ClientServer MUST expect Client to send messages according to selected subprotocol. ```php $server->addMiddleware(new WebSocket\Middleware\SubprotocolNegotiation([ diff --git a/docs/Migrate_2_3.md b/docs/Migrate_2_3.md index dd0fa36..090ec1e 100644 --- a/docs/Migrate_2_3.md +++ b/docs/Migrate_2_3.md @@ -17,7 +17,7 @@ MiddlewareHandler->setLogger(LoggerInterface $logger): void These methods now return `void` instead of `self.` This means method return can not be chained. -The change makes v3 complient with `psr/log v3`. +The change makes v3 compliant with `psr/log v3`. ### receive diff --git a/docs/Server.md b/docs/Server.md index 2945de7..e60ecdb 100644 --- a/docs/Server.md +++ b/docs/Server.md @@ -3,7 +3,7 @@ # Websocket: Server The library contains a multi-connection listening server based on coroutine runtime. -It does not support full parallell processing through threads or separate processes. +It does not support full parallel processing through threads or separate processes. ## Basic operation @@ -29,7 +29,7 @@ $server ## Configuration The Server takes two arguments; port and ssl. -By default ssl is false. If port is not specified, it will use 80 for non-secure and 443 for secure server. +By default, ssl is false. If port is not specified, it will use 80 for non-secure and 443 for secure server. Other options are available runtime by calling configuration methods. ```php @@ -129,7 +129,7 @@ $connection->send(new WebSocket\Message\Ping("My ping")); $connection->send(new WebSocket\Message\Text("My pong")); $connection->send(new WebSocket\Message\Close(1000, "Closing now")); ``` -The are also convenience methods available for all types. +There are also convenience methods available for all types. ```php $connection->text("Server sends a message"); $connection->binary($binary); diff --git a/src/Middleware/ProcessHttpStack.php b/src/Middleware/ProcessHttpStack.php index b809e62..92d7460 100644 --- a/src/Middleware/ProcessHttpStack.php +++ b/src/Middleware/ProcessHttpStack.php @@ -41,7 +41,7 @@ public function __construct(Connection $connection, HttpHandler $httpHandler, ar } /** - * Process middleware for incoming htpp message. + * Process middleware for incoming http message. * @return Message */ public function handleHttpIncoming(): Message @@ -54,7 +54,7 @@ public function handleHttpIncoming(): Message } /** - * Process middleware for outgoing htpp message. + * Process middleware for outgoing http message. * @param Message $message * @return Message */ diff --git a/src/Server.php b/src/Server.php index 2de9dad..b3315ca 100644 --- a/src/Server.php +++ b/src/Server.php @@ -404,7 +404,7 @@ public function isRunning(): bool */ public function shutdown(int $closeStatus = 1001): void { - $this->logger->info('[server] Shutting dowm'); + $this->logger->info('[server] Shutting down'); if ($this->getConnectionCount() == 0) { $this->disconnect(); } diff --git a/src/Trait/SendMethodsTrait.php b/src/Trait/SendMethodsTrait.php index 75e93bd..8a29a31 100644 --- a/src/Trait/SendMethodsTrait.php +++ b/src/Trait/SendMethodsTrait.php @@ -17,7 +17,7 @@ /** * WebSocket\Trait\SendMethodsTrait trait. - * Conveniance send methods. + * Convenience send methods. */ trait SendMethodsTrait { diff --git a/tests/suites/client/ClientErrorTest.php b/tests/suites/client/ClientErrorTest.php index b648aa7..e9ebcd0 100644 --- a/tests/suites/client/ClientErrorTest.php +++ b/tests/suites/client/ClientErrorTest.php @@ -122,7 +122,7 @@ public function testFailedConnection(): void unset($client); } - public function testRecieveBadOpcode(): void + public function testReceiveBadOpcode(): void { $this->expectStreamFactory(); $client = new Client('ws://localhost:8000/my/mock/path'); diff --git a/tests/suites/client/ClientTest.php b/tests/suites/client/ClientTest.php index 02ce58b..1d682f2 100644 --- a/tests/suites/client/ClientTest.php +++ b/tests/suites/client/ClientTest.php @@ -724,7 +724,7 @@ public function testFrameFragmentation(): void unset($client); } - public function testConvenicanceMethods(): void + public function testConvenienceMethods(): void { $this->expectStreamFactory(); $client = new Client('ws://localhost:8000/my/mock/path'); diff --git a/tests/suites/http/RequestTest.php b/tests/suites/http/RequestTest.php index f0a39b7..d766ce8 100644 --- a/tests/suites/http/RequestTest.php +++ b/tests/suites/http/RequestTest.php @@ -222,7 +222,7 @@ public function testHeaderNameError(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionCode(0); $this->expectExceptionMessage("'.' is not a valid header field name."); - $request->withHeader('.', 'invaid name'); + $request->withHeader('.', 'invalid name'); } #[DataProvider('provideInvalidHeaderValues')] diff --git a/tests/suites/http/ResponseTest.php b/tests/suites/http/ResponseTest.php index d1ae3f8..14f67b8 100644 --- a/tests/suites/http/ResponseTest.php +++ b/tests/suites/http/ResponseTest.php @@ -123,6 +123,6 @@ public function testHeaderNameError(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionCode(0); $this->expectExceptionMessage("'.' is not a valid header field name."); - $response->withHeader('.', 'invaid name'); + $response->withHeader('.', 'invalid name'); } }