Skip to content

Commit 719f379

Browse files
committed
Improve documentation
1 parent 30d4e53 commit 719f379

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# clue/reactphp-multicast
22

3-
[![CI status](https://github.com/clue/reactphp-multicast/workflows/CI/badge.svg)](https://github.com/clue/reactphp-multicast/actions)
3+
[![CI status](https://github.com/clue/reactphp-multicast/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-multicast/actions)
44
[![installs on Packagist](https://img.shields.io/packagist/dt/clue/multicast-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/multicast-react)
55

66
Simple, event-driven multicast UDP message client and server for [ReactPHP](https://reactphp.org/).
@@ -41,6 +41,10 @@ Once [installed](#install), you can use the following code to create a simple
4141
echo server that listens for incoming multicast messages:
4242

4343
```php
44+
<?php
45+
46+
require __DIR__ . '/vendor/autoload.php';
47+
4448
$factory = new Clue\React\Multicast\Factory();
4549
$socket = $factory->createReceiver('224.10.20.30:4050');
4650

@@ -51,7 +55,7 @@ $socket->on('message', function ($data, $remote) use ($socket) {
5155

5256
```
5357

54-
See also the [examples](examples).
58+
See also the [examples](examples/).
5559

5660
## Usage
5761

@@ -108,13 +112,12 @@ $socket->on('message', function ($data, $remote) use ($socket) {
108112
});
109113
```
110114

111-
This method requires PHP 5.4 (or up) and `ext-sockets`.
115+
This method requires PHP 5.4+ and `ext-sockets`.
112116
Otherwise, it will throw a `BadMethodCallException`.
113117
This is a requirement because receiving multicast datagrams requires a
114118
[level 2 multicast conformant](https://www.tldp.org/HOWTO/Multicast-HOWTO-2.html#ss2.2)
115119
socket API.
116-
The required multicast socket options and constants have been added with
117-
[PHP 5.4](http://php.net/manual/en/migration54.global-constants.php) (and up).
120+
The required multicast socket options and constants have been added with PHP 5.4+.
118121
These options are only available to the low level socket API (ext-sockets), not
119122
to the newer stream based networking API.
120123

@@ -147,22 +150,22 @@ Please refer to the [datagram documentation](https://github.com/reactphp/datagra
147150

148151
## Install
149152

150-
The recommended way to install this library is [through Composer](https://getcomposer.org).
153+
The recommended way to install this library is [through Composer](https://getcomposer.org/).
151154
[New to Composer?](https://getcomposer.org/doc/00-intro.md)
152155

153156
This project follows [SemVer](https://semver.org/).
154157
This will install the latest supported version:
155158

156159
```bash
157-
$ composer require clue/multicast-react:^1.1
160+
composer require clue/multicast-react:^1.1
158161
```
159162

160163
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
161164

162165
This project aims to run on any platform and thus does not require any PHP
163166
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
164167
HHVM.
165-
It's *highly recommended to use PHP 7+* for this project.
168+
It's *highly recommended to use the latest supported PHP version* for this project.
166169

167170
The [`createSender()`](#createsender) method works on all supported platforms
168171
without any additional requirements. However, the [`createReceiver()`](#createreceiver)
@@ -171,16 +174,16 @@ method requires PHP 5.4 (or up) and `ext-sockets`. See above for more details.
171174
## Tests
172175

173176
To run the test suite, you first need to clone this repo and then install all
174-
dependencies [through Composer](https://getcomposer.org):
177+
dependencies [through Composer](https://getcomposer.org/):
175178

176179
```bash
177-
$ composer install
180+
composer install
178181
```
179182

180183
To run the test suite, go to the project root and run:
181184

182185
```bash
183-
$ php vendor/bin/phpunit
186+
php vendor/bin/phpunit
184187
```
185188

186189
## License

src/Factory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@ public function createSender()
8282
* });
8383
* ```
8484
*
85-
* This method requires PHP 5.4 (or up) and `ext-sockets`.
85+
* This method requires PHP 5.4+ and `ext-sockets`.
8686
* Otherwise, it will throw a `BadMethodCallException`.
8787
* This is a requirement because receiving multicast datagrams requires a
8888
* [level 2 multicast conformant](https://www.tldp.org/HOWTO/Multicast-HOWTO-2.html#ss2.2)
8989
* socket API.
90-
* The required multicast socket options and constants have been added with
91-
* [PHP 5.4](http://php.net/manual/en/migration54.global-constants.php) (and up).
90+
* The required multicast socket options and constants have been added with PHP 5.4+.
9291
* These options are only available to the low level socket API (ext-sockets), not
9392
* to the newer stream based networking API.
9493
*

0 commit comments

Comments
 (0)