Skip to content

Commit

Permalink
Merge pull request #72 from pieterocp/fix-typoes
Browse files Browse the repository at this point in the history
Fix typoes
  • Loading branch information
sirn-se authored Jul 23, 2024
2 parents 36a79ed + e5696b3 commit 1de1621
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ $server

### License

[ISC License](COPYING.md)
[ISC License](LICENSE.md)

4 changes: 2 additions & 2 deletions docs/Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
```
Expand Down
6 changes: 3 additions & 3 deletions docs/Listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion docs/Middleware/CloseHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Middleware/FollowRedirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Middleware/PingResponder.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Middleware/SubprotocolNegotiation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion docs/Migrate_2_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions docs/Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/ProcessHttpStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Trait/SendMethodsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* WebSocket\Trait\SendMethodsTrait trait.
* Conveniance send methods.
* Convenience send methods.
*/
trait SendMethodsTrait
{
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/client/ClientErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/client/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/http/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit 1de1621

Please sign in to comment.