Skip to content

Commit 22806b0

Browse files
committed
Documentation
1 parent c2d77d8 commit 22806b0

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

docs/Classes/Client.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Classes: [Client](Client.md) • Server
2+
3+
# Client class
4+
5+
Websocket Client class.
6+

docs/Classes/Connection.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Classes: [Client](Client.md) • Server
2+
3+
# Connection class
4+
5+
Websocket Connection class.
6+

docs/Classes/Message.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Classes: [Client](Client.md) • Server
2+
3+
# Message class
4+
5+
Websocket Message class.
6+

docs/Classes/Server.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Classes: [Client](Classes/Client.md) • Server
1+
Classes: [Client](Client.md) • Server
22

33
# Server class
44

@@ -65,22 +65,22 @@ public function __construct(array $options = [])
6565
###### `options`
6666

6767
An optional array of parameters.
68-
| Name | Type | | Default | Description |
69-
| --- | --- | --- | --- [
70-
| `filter` | `array` | `['text', 'binary']` | Array of opcodes to return on receive and listen functions
71-
| `fragment_size` | `int` | `4096` | Maximum payload size
72-
| `logger` | `Psr\Log\LoggerInterface` | `Psr\Log\NullLogger` |A [PSR-3](https://www.php-fig.org/psr/psr-3/) compatible logger
73-
| `port` | `int` | `8000` | The server port to listen to
74-
| `return_obj` | `bool` | `false` | Return a [Message](Classes/Message.md) instance on receive function
75-
| `timeout` | `int` | `5` | Time out in seconds
68+
Name | Type | Default | Description
69+
--- | --- | --- | ---
70+
filter` | array | ['text', 'binary'] | Array of opcodes to return on receive and listen functions
71+
fragment_size | int | 4096 | Maximum payload size
72+
logger | Psr\Log\LoggerInterface | Psr\Log\NullLogger |A [PSR-3](https://www.php-fig.org/psr/psr-3/) compatible logger
73+
port | int | 8000 | The server port to listen to
74+
return_obj | bool | false | Return a [Message](Message.md) instance on receive function
75+
timeout | int | 5 | Time out in seconds
7676

7777
#### Return Values
7878

7979
Returns a new WebSocket\Server instance.
8080

8181
#### Errors/Exceptions
8282

83-
Emits [ConnectionException](Classes/ConnectionException.md) on failure.
83+
Emits [ConnectionException](ConnectionException.md) on failure.
8484

8585
#### Examples
8686

@@ -129,8 +129,8 @@ public function listen(Closure $callback) : mixed
129129
A callback function that is triggered whenever the server receives a message matching the filter.
130130

131131
The callback takes two parameters;
132-
* The [Message](Classes/Message/Message.md) that has been received
133-
* The [Connection](Classes/Connection.md) the server has receievd on, can be `null` if connection is closed
132+
* The [Message](Message/Message.md) that has been received
133+
* The [Connection](Connection.md) the server has receievd on, can be `null` if connection is closed
134134

135135
If callback function returns non-null value, the listener will halt and return that value.
136136
Otherwise it will continue listening and propagating messages.
@@ -141,7 +141,7 @@ Returns any non-null value returned by callback function.
141141

142142
#### Errors/Exceptions
143143

144-
Emits [ConnectionException](Classes/ConnectionException.md) on failure.
144+
Emits [ConnectionException](ConnectionException.md) on failure.
145145

146146
#### Examples
147147

@@ -173,7 +173,7 @@ Halt listener and return a value to calling code.
173173
```php
174174
<?php
175175

176-
$server = new WebSocket\Server(['filter' => ['text', 'binary', 'ping', 'pong', 'close']]);
176+
$server = new WebSocket\Server();
177177
$content = $server->listen(function ($message, $connection) {
178178
return $message->getContent();
179179
});

0 commit comments

Comments
 (0)